Skip to content

Commit 5910b93

Browse files
committed
1 parent 96ce385 commit 5910b93

File tree

1 file changed

+8
-29
lines changed

1 file changed

+8
-29
lines changed

.github/workflows/track_fork_pr_benchmarks.yml

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,15 @@ jobs:
1414
PR_EVENT: event.json
1515
steps:
1616
- name: Download Benchmark Results
17-
uses: actions/github-script@v7
17+
uses: dawidd6/action-download-artifact@v6
1818
with:
19-
script: |
20-
async function downloadArtifact(artifactName) {
21-
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
22-
owner: context.repo.owner,
23-
repo: context.repo.repo,
24-
run_id: context.payload.workflow_run.id,
25-
});
26-
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
27-
return artifact.name == artifactName
28-
})[0];
29-
if (!matchArtifact) {
30-
core.setFailed(`Failed to find artifact: ${artifactName}`);
31-
}
32-
let download = await github.rest.actions.downloadArtifact({
33-
owner: context.repo.owner,
34-
repo: context.repo.repo,
35-
artifact_id: matchArtifact.id,
36-
archive_format: 'zip',
37-
});
38-
let fs = require('fs');
39-
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/${artifactName}.zip`, Buffer.from(download.data));
40-
}
41-
await downloadArtifact(process.env.BENCHMARK_RESULTS);
42-
await downloadArtifact(process.env.PR_EVENT);
43-
- name: Unzip Benchmark Results
44-
run: |
45-
unzip $BENCHMARK_RESULTS.zip
46-
unzip $PR_EVENT.zip
19+
name: ${{ env.BENCHMARK_RESULTS }}
20+
run_id: ${{ github.event.workflow_run.id }}
21+
- name: Download PR Event
22+
uses: dawidd6/action-download-artifact@v6
23+
with:
24+
name: ${{ env.PR_EVENT }}
25+
run_id: ${{ github.event.workflow_run.id }}
4726
- name: Export PR Event Data
4827
uses: actions/github-script@v7
4928
with:

0 commit comments

Comments
 (0)