From 11e3ccfa4d0d1053d9e6de9a0f1587674b6be3e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 6 Jul 2023 23:59:18 +0200 Subject: [PATCH] gha: ci: Avoid using env unless it's really needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit de83cd9de79226b15519e07871dcdee635d501c6 tried to solve an issue, but it clearly seems that I'm using env wrongly, as what ended up being passed as input was "$VAR", instead of the content of the VAR variable. As we can simply avoid using those here, let's do it and save us a headache. Fixes: #7247 Signed-off-by: Fabiano FidĂȘncio --- .github/workflows/ci-nightly.yaml | 9 +++------ .github/workflows/ci-on-push.yaml | 10 +++------- .github/workflows/payload-after-push.yaml | 15 ++++++--------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-nightly.yaml b/.github/workflows/ci-nightly.yaml index 56bb5c9599..81380a7d14 100644 --- a/.github/workflows/ci-nightly.yaml +++ b/.github/workflows/ci-nightly.yaml @@ -3,9 +3,6 @@ on: schedule: - cron: '0 0 * * *' -env: - COMMIT_HASH: ${GITHUB_REF} - jobs: set-fake-pr-number: runs-on: ubuntu-latest @@ -18,6 +15,6 @@ jobs: needs: set-fake-pr-number uses: ./.github/workflows/ci.yaml with: - commit-hash: $COMMIT_HASH - pr-number: $PR_NUMBER - tag: $PR_NUMBER-$COMMIT_HASH-nightly + commit-hash: ${GITHUB_REF} + pr-number: ${PR_NUMBER} + tag: ${PR_NUMBER}-${GITHUB_REF}-nightly diff --git a/.github/workflows/ci-on-push.yaml b/.github/workflows/ci-on-push.yaml index eccd2b3847..d5549d458b 100644 --- a/.github/workflows/ci-on-push.yaml +++ b/.github/workflows/ci-on-push.yaml @@ -12,15 +12,11 @@ on: - synchronize - reopened - labeled -env: - COMMIT_HASH: ${{ github.event.pull_request.head.sha }} - PR_NUMBER: ${{ github.event.pull_request.number }} - jobs: kata-containers-ci-on-push: if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} uses: ./.github/workflows/ci.yaml with: - commit-hash: $COMMIT_HASH - pr-number: $PR_NUMBER - tag: $PR_NUMBER-$COMMIT_HASH + commit-hash: ${{ github.event.pull_request.sha }} + pr-number: ${{ github.event.pull_request.number }} + tag: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }} diff --git a/.github/workflows/payload-after-push.yaml b/.github/workflows/payload-after-push.yaml index fabd987b72..2e4e71d4b2 100644 --- a/.github/workflows/payload-after-push.yaml +++ b/.github/workflows/payload-after-push.yaml @@ -5,28 +5,25 @@ on: - main - stable-* -env: - COMMIT_HASH: $GITHUB_REF - jobs: build-assets-amd64: uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml with: - commit-hash: $COMMIT_HASH + commit-hash: ${GITHUB_REF} push-to-registry: yes secrets: inherit build-assets-arm64: uses: ./.github/workflows/build-kata-static-tarball-arm64.yaml with: - commit-hash: $COMMIT_HASH + commit-hash: ${GITHUB_REF} push-to-registry: yes secrets: inherit build-assets-s390x: uses: ./.github/workflows/build-kata-static-tarball-s390x.yaml with: - commit-hash: $COMMIT_HASH + commit-hash: ${GITHUB_REF} push-to-registry: yes secrets: inherit @@ -34,7 +31,7 @@ jobs: needs: build-assets-amd64 uses: ./.github/workflows/publish-kata-deploy-payload-amd64.yaml with: - commit-hash: $COMMIT_HASH + commit-hash: ${GITHUB_REF} registry: quay.io repo: kata-containers/kata-deploy-ci tag: kata-containers-amd64 @@ -44,7 +41,7 @@ jobs: needs: build-assets-arm64 uses: ./.github/workflows/publish-kata-deploy-payload-arm64.yaml with: - commit-hash: $COMMIT_HASH + commit-hash: ${GITHUB_REF} registry: quay.io repo: kata-containers/kata-deploy-ci tag: kata-containers-arm64 @@ -54,7 +51,7 @@ jobs: needs: build-assets-s390x uses: ./.github/workflows/publish-kata-deploy-payload-s390x.yaml with: - commit-hash: $COMMIT_HASH + commit-hash: ${GITHUB_REF} registry: quay.io repo: kata-containers/kata-deploy-ci tag: kata-containers-s390x