Skip to content

Commit f3fa28f

Browse files
committed
wip
1 parent e1b4260 commit f3fa28f

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

.github/actions/deploy/action.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ runs:
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('${{ toJSON(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"

.github/workflows/deploy_staging.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
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' }}

.github/workflows/tests.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,20 @@ jobs:
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/

0 commit comments

Comments
 (0)