File tree Expand file tree Collapse file tree 3 files changed +24
-8
lines changed
Expand file tree Collapse file tree 3 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 1616 run_id: context.payload.workflow_run.id,
1717 });
1818 let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
19- return artifact.name == "pr_number "
19+ return artifact.name == "run_number "
2020 })[0];
2121 let download = await github.rest.actions.downloadArtifact({
2222 owner: context.repo.owner,
@@ -26,17 +26,14 @@ runs:
2626 });
2727 const fs = require('fs');
2828 const path = require('path');
29- const temp = '${{ runner.temp }}/artifacts';
29+ const temp = '${{ runner.temp }}';
30+ console.log('${{ github.event }}');
3031 if (!fs.existsSync(temp)){
3132 fs.mkdirSync(temp);
3233 }
33- fs.writeFileSync(path.join(temp, 'pr_number .zip'), Buffer.from(download.data));
34+ fs.writeFileSync(path.join(temp, 'run_number .zip'), Buffer.from(download.data));
3435
3536 - name : ' Unzip artifact'
36- shell : bash
37- run : unzip pr_number.zip -d "${{ runner.temp }}/artifacts"
38-
39- - name : ' Inspect artifact'
4037 shell : bash
4138 run : |
42- cat ${{ runner.temp }}/artifacts/pr_number
39+ unzip ${{ runner.temp }}/run_number.zip -d "${{ runner.temp }}/artifacts"
Original file line number Diff line number Diff line change 1818 - uses : actions/checkout@v4
1919 - uses : ./.github/actions/deploy
2020
21+ - run : cat ${{ runner.temp }}/artifacts/run_number
22+
2123 on-failure :
2224 runs-on : ubuntu-latest
2325 if : ${{ github.event.workflow_run.conclusion == 'failure' }}
Original file line number Diff line number Diff line change 88 steps :
99 - run : |
1010 echo "Tests passed"
11+
12+ build-artifacts :
13+ needs :
14+ - tests
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Save RUN number
18+ env :
19+ RUN_NUMBER : ${{ github.run_number }}
20+ run : |
21+ mkdir -p ./run
22+ echo $RUN_NUMBER > ./run/run_number
23+
24+ - uses : actions/upload-artifact@v4
25+ with :
26+ name : run_number
27+ path : run/
You can’t perform that action at this time.
0 commit comments