gha: ci-on-push: Adjust to using workflow_run

The way previously used to get the PR's commit sha can only be used with
`pull_request*` kind of events.

Let's adapt it to the `workflow_run` now that we're using it.

With this change we ended up dropping the PR number from the tarball
suffix, as that's not straightforward to get and, to be honest, not a
unique differentiator that would justify the effort.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-04-05 10:24:31 +02:00
parent a159ffdba7
commit 3a760a157a

View File

@ -11,16 +11,16 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }} if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml
with: with:
tarball-suffix: -${{ github.event.pull_request.number}}-${{ github.sha }} tarball-suffix: -${{ github.event.workflow_run.head_sha }}
publish-kata-deploy-payload-amd64: publish-kata-deploy-payload-amd64:
needs: build-kata-static-tarball-amd64 needs: build-kata-static-tarball-amd64
uses: ./.github/workflows/publish-kata-deploy-payload-amd64.yaml uses: ./.github/workflows/publish-kata-deploy-payload-amd64.yaml
with: with:
tarball-suffix: -${{ github.event.pull_request.number}}-${{ github.sha }} tarball-suffix: -${{ github.event.workflow_run.head_sha }}
registry: ghcr.io registry: ghcr.io
repo: ${{ github.repository_owner }}/kata-deploy-ci repo: ${{ github.repository_owner }}/kata-deploy-ci
tag: ${{ github.event.pull_request.number }}-${{ github.sha }}-amd64 tag: ${{ github.event.workflow_run.head_sha }}-amd64
quay-io-login-continue-on-error: true quay-io-login-continue-on-error: true
secrets: inherit secrets: inherit
@ -30,5 +30,5 @@ jobs:
with: with:
registry: ghcr.io registry: ghcr.io
repo: ${{ github.repository_owner }}/kata-deploy-ci repo: ${{ github.repository_owner }}/kata-deploy-ci
tag: ${{ github.event.pull_request.number }}-${{ github.sha }}-amd64 tag: ${{ github.event.workflow_run.head_sha }}-amd64
secrets: inherit secrets: inherit