From 3ca11f11518e0906cfa0f00dbbd57dc6219c1e3d Mon Sep 17 00:00:00 2001 From: Heba Elayoty <31887807+helayoty@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:05:20 -0700 Subject: [PATCH] Update publish-image-acr.yml Signed-off-by: Heba Elayoty <31887807+helayoty@users.noreply.github.com> --- .github/workflows/publish-image-acr.yml | 45 ++----------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/.github/workflows/publish-image-acr.yml b/.github/workflows/publish-image-acr.yml index 21985b93f..f34bfb8b2 100644 --- a/.github/workflows/publish-image-acr.yml +++ b/.github/workflows/publish-image-acr.yml @@ -1,10 +1,6 @@ name: Push image to ACR on: workflow_dispatch: - workflow_run: - workflows: [ "Create release" ] - types: [ completed ] - branches: [release-** ] permissions: @@ -17,52 +13,15 @@ env: jobs: publish: - if: | - always() && - (github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch') runs-on: ubuntu-20.04 steps: - name: Set up Go ${{ env.GO_VERSION }} uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: Download tag artifact - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.KDM_ACCESS_TOKEN_READ }} - script: | - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "artifacts" - })[0]; - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - let fs = require('fs'); - fs.writeFileSync(`/tmp/artifacts.zip`, Buffer.from(download.data)); - - run: | - mkdir -p /tmp/artifacts - unzip /tmp/artifacts.zip -d /tmp/artifacts - shell: bash - - run: | - echo "Downloaded artifacts:" - ls -ablh /tmp/artifacts - shell: bash - - name: Parse artifacts and assign GA environment variables + - name: Set Image Tag run: | - tag=$(tail -n 1 /tmp/artifacts/tag.txt) + tag=${{ github.ref }} echo "IMG_TAG=$tag" >> $GITHUB_ENV - uses: actions/checkout@v4 with: