2929 runs-on : ubuntu-latest
3030 needs : release-drafter
3131 permissions :
32- # For actions/ download-artifact
32+ # For $ gh run download
3333 actions : read
3434 # For GoReleaser
3535 contents : write
3838 attestations : write
3939 artifact-metadata : write
4040 steps :
41- - run : gh api repos/typisttech/php-matrix/actions/runs/${{ inputs.run_id }}/artifacts
42- env :
43- GH_TOKEN : ${{ github.token }}
44-
45- - name : List artifacts for run
46- uses : actions/github-script@v6
47- with :
48- script : |
49- const runId = parseInt('${{ inputs.run_id }}', 10)
50- const res = await github.rest.actions.listWorkflowRunArtifacts({
51- owner: context.repo.owner,
52- repo: context.repo.repo,
53- run_id: runId
54- })
55- console.log(`Artifacts for run ${runId}:`)
56- res.data.artifacts.forEach(a => console.log(`- ${a.name}`))
57- if (res.data.total_count === 0) core.setFailed(`No artifacts found for run ${runId}`)
58-
5941 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6042 with :
6143 fetch-depth : 0
@@ -65,27 +47,10 @@ jobs:
6547 with :
6648 go-version : stable
6749
68- - uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
69- with :
70- name : php-matrix_linux_arm64
71- path : out/linux_arm64
72- run-id : ${{ inputs.run_id }}
73-
74- - uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
75- with :
76- name : php-matrix_linux_amd64
77- path : out/linux_amd64
78- run-id : ${{ inputs.run_id }}
79- - uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
80- with :
81- name : php-matrix_darwin_arm64
82- path : out/darwin_arm64
83- run-id : ${{ inputs.run_id }}
84- - uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
85- with :
86- name : php-matrix_darwin_amd64
87- path : out/darwin_amd64
88- run-id : ${{ inputs.run_id }}
50+ - run : gh run download "${RUN_ID}" -D out -p 'php-matrix_*'
51+ env :
52+ RUN_ID : ${{ github.run_id }}
53+ GH_TOKEN : ${{ github.token }}
8954
9055 - uses : actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
9156 id : app-token
0 commit comments