Skip to content

Commit 01704a5

Browse files
authored
Simplify action steps (#24)
* use standard action for downloading the report
1 parent 12d3022 commit 01704a5

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

review/action.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ outputs:
2323
runs:
2424
using: "composite"
2525
steps:
26+
# save report since the checkout step deletes it
2627
- uses: actions/upload-artifact@v4
2728
id: vul-report-upload
2829
with:
@@ -31,25 +32,22 @@ runs:
3132
run: echo "Artifact ID is ${{ steps.vul-report-upload.outputs.artifact-id }}"
3233
shell: bash -l {0}
3334

35+
# needed since we get wrong hash. this step deletes the report file, so need to save it beforehand
3436
- uses: actions/checkout@v3
3537
name: checkout-to-branch
3638
with:
3739
ref: ${{ github.head_ref }}
3840

39-
- id: download-vul-report
40-
run: |
41-
echo "url is: https://api.github.com/repos/$GITHUB_REPOSITORY/actions/artifacts/${{ steps.vul-report-upload.outputs.artifact-id }}/zip"
42-
curl -L \
43-
-H "Accept: application/vnd.github+json" \
44-
-H "Authorization: Bearer ${{ inputs.github-token }}" \
45-
-H "X-GitHub-Api-Version: 2022-11-28" \
46-
-o vul_report.zip \
47-
https://api.github.com/repos/$GITHUB_REPOSITORY/actions/artifacts/${{ steps.vul-report-upload.outputs.artifact-id }}/zip
48-
unzip -d results vul_report.zip
49-
shell: bash -l {0}
41+
# restore the report file
42+
- uses: actions/download-artifact@v4
43+
with:
44+
name: vul-report
45+
path: results
46+
5047
- uses: actions/setup-node@v3.6.0
5148
with:
5249
node-version: 18
50+
5351
- id: run-npx-mobb-dev
5452
run: |
5553
REPO=$(git remote get-url origin)
@@ -68,6 +66,7 @@ runs:
6866
6967
echo "fix-report-url=$OUT" >> $GITHUB_OUTPUT
7068
shell: bash -l {0}
69+
7170
- uses: Sibz/github-status-action@v1
7271
with:
7372
authToken: ${{ inputs.github-token }}

0 commit comments

Comments
 (0)