refactor run-id handling

This commit is contained in:
fkwp
2024-04-23 16:46:26 +02:00
parent b32d066a76
commit af99d2a60b
4 changed files with 13 additions and 2 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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 }}

View File

@@ -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}}