From af99d2a60b60c3c6490a3366f669920131ada151 Mon Sep 17 00:00:00 2001 From: fkwp Date: Tue, 23 Apr 2024 16:46:26 +0200 Subject: [PATCH] refactor run-id handling --- .github/workflows/docker.yaml | 6 +++++- .github/workflows/netlify.yaml | 6 +++++- .github/workflows/pr-deploy.yaml | 2 ++ .github/workflows/publish.yaml | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 5d6bf8243..e3363d3c0 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -5,6 +5,10 @@ on: docker_tags: required: true type: string + artifact_run_id: + required: false + type: string + default: ${{ github.run_id }} env: REGISTRY: ghcr.io @@ -25,7 +29,7 @@ jobs: uses: actions/download-artifact@v4 with: github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id || github.run_id }} + run-id: ${{ inputs.artifact_run_id }} name: build-output path: dist diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml index a10eacc88..602190ce2 100644 --- a/.github/workflows/netlify.yaml +++ b/.github/workflows/netlify.yaml @@ -14,6 +14,10 @@ on: deployment_ref: required: true type: string + artifact_run_id: + required: false + type: string + default: ${{ github.run_id }} secrets: ELEMENT_BOT_TOKEN: required: true @@ -45,7 +49,7 @@ jobs: uses: actions/download-artifact@v4 with: github-token: ${{ secrets.ELEMENT_BOT_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} + run-id: ${{ inputs.artifact_run_id }} name: build-output path: webapp diff --git a/.github/workflows/pr-deploy.yaml b/.github/workflows/pr-deploy.yaml index 032e60a3b..73ec70c84 100644 --- a/.github/workflows/pr-deploy.yaml +++ b/.github/workflows/pr-deploy.yaml @@ -26,6 +26,7 @@ jobs: deployments: write uses: ./.github/workflows/netlify.yaml with: + artifact_run_id: ${{ github.event.workflow_run.id || github.run_id }} pr_number: ${{ needs.prdetails.outputs.pr_number }} pr_head_full_name: ${{ github.event.workflow_run.head_repository.full_name }} pr_head_ref: ${{ needs.prdetails.outputs.pr_data_json && fromJSON(needs.prdetails.outputs.pr_data_json).head.ref }} @@ -43,6 +44,7 @@ jobs: packages: write uses: ./.github/workflows/docker.yaml with: + artifact_run_id: ${{ github.event.workflow_run.id || github.run_id }} docker_tags: | type=sha,format=short,event=branch type=raw,value=pr_${{ needs.prdetails.outputs.pr_number }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 13b39c75e..1ff761d6b 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -64,6 +64,7 @@ jobs: packages: write uses: ./.github/workflows/docker.yaml with: + artifact_run_id: ${{ github.event.workflow_run.id || github.run_id }} docker_tags: | type=sha,format=short,event=branch type=semver,pattern=v{{version}}