Skip to content

Commit 4a9cbf7

Browse files
authored
Fix Resyntax workflow artifact download step (#1261)
1 parent 6ffb575 commit 4a9cbf7

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/resyntax-submit-review.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,29 @@ jobs:
2222
- name: Checkout code
2323
uses: actions/[email protected]
2424
- name: Download Resyntax analysis
25-
uses: actions/[email protected]
25+
# This uses a github script instead of the download-artifact action because
26+
# that action doesn't work for artifacts uploaded by other workflows. See
27+
# https://github.com/actions/download-artifact/issues/130 for more info.
28+
uses: actions/[email protected]
2629
with:
27-
name: resyntax-review
30+
script: |
31+
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
run_id: ${{github.event.workflow_run.id }},
35+
});
36+
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
37+
return artifact.name == "resyntax-review"
38+
})[0];
39+
var download = await github.rest.actions.downloadArtifact({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
artifact_id: matchArtifact.id,
43+
archive_format: 'zip',
44+
});
45+
var fs = require('fs');
46+
fs.writeFileSync('${{github.workspace}}/resyntax-review.zip', Buffer.from(download.data));
47+
- run: unzip resyntax-review.zip
2848
- name: Create pull request review
2949
uses: actions/[email protected]
3050
with:

0 commit comments

Comments
 (0)