Merge pull request #2333 from element-hq/fkwp/refactor_gh_action_run-id
refactor run-id handling of GitHub Actions
This commit is contained in:
6
.github/workflows/docker.yaml
vendored
6
.github/workflows/docker.yaml
vendored
@@ -5,6 +5,10 @@ on:
|
|||||||
docker_tags:
|
docker_tags:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
artifact_run_id:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ${{ github.run_id }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
@@ -25,7 +29,7 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run-id: ${{ github.event.workflow_run.id || github.run_id }}
|
run-id: ${{ inputs.artifact_run_id }}
|
||||||
name: build-output
|
name: build-output
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
|
|||||||
6
.github/workflows/netlify.yaml
vendored
6
.github/workflows/netlify.yaml
vendored
@@ -14,6 +14,10 @@ on:
|
|||||||
deployment_ref:
|
deployment_ref:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
artifact_run_id:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ${{ github.run_id }}
|
||||||
secrets:
|
secrets:
|
||||||
ELEMENT_BOT_TOKEN:
|
ELEMENT_BOT_TOKEN:
|
||||||
required: true
|
required: true
|
||||||
@@ -45,7 +49,7 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
run-id: ${{ github.event.workflow_run.id }}
|
run-id: ${{ inputs.artifact_run_id }}
|
||||||
name: build-output
|
name: build-output
|
||||||
path: webapp
|
path: webapp
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/pr-deploy.yaml
vendored
2
.github/workflows/pr-deploy.yaml
vendored
@@ -26,6 +26,7 @@ jobs:
|
|||||||
deployments: write
|
deployments: write
|
||||||
uses: ./.github/workflows/netlify.yaml
|
uses: ./.github/workflows/netlify.yaml
|
||||||
with:
|
with:
|
||||||
|
artifact_run_id: ${{ github.event.workflow_run.id || github.run_id }}
|
||||||
pr_number: ${{ needs.prdetails.outputs.pr_number }}
|
pr_number: ${{ needs.prdetails.outputs.pr_number }}
|
||||||
pr_head_full_name: ${{ github.event.workflow_run.head_repository.full_name }}
|
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 }}
|
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
|
packages: write
|
||||||
uses: ./.github/workflows/docker.yaml
|
uses: ./.github/workflows/docker.yaml
|
||||||
with:
|
with:
|
||||||
|
artifact_run_id: ${{ github.event.workflow_run.id || github.run_id }}
|
||||||
docker_tags: |
|
docker_tags: |
|
||||||
type=sha,format=short,event=branch
|
type=sha,format=short,event=branch
|
||||||
type=raw,value=pr_${{ needs.prdetails.outputs.pr_number }}
|
type=raw,value=pr_${{ needs.prdetails.outputs.pr_number }}
|
||||||
|
|||||||
1
.github/workflows/publish.yaml
vendored
1
.github/workflows/publish.yaml
vendored
@@ -64,6 +64,7 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
uses: ./.github/workflows/docker.yaml
|
uses: ./.github/workflows/docker.yaml
|
||||||
with:
|
with:
|
||||||
|
artifact_run_id: ${{ github.event.workflow_run.id || github.run_id }}
|
||||||
docker_tags: |
|
docker_tags: |
|
||||||
type=sha,format=short,event=branch
|
type=sha,format=short,event=branch
|
||||||
type=semver,pattern=v{{version}}
|
type=semver,pattern=v{{version}}
|
||||||
|
|||||||
Reference in New Issue
Block a user