Skip to content

Commit 8d54bd8

Browse files
committed
Combine audit and list reports; refactoring.
This is headed toward being a shared GitHub Action, so it can be run on both the old code and the new/latest code (without copying and pasting...).
1 parent 64442e5 commit 8d54bd8

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

.github/workflows/osv-scanner-pr.yaml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@ jobs:
143143
echo "$LIST" >> $GITHUB_OUTPUT
144144
echo "$delimiter" >> $GITHUB_OUTPUT
145145
continue-on-error: true
146+
- name: combine npm audit/list reports
147+
id: combined_report
148+
run: |
149+
# Use a random delimiter to capture the multi-line output
150+
delimiter=$(openssl rand -hex 8)
151+
echo "result<<$delimiter" >> $GITHUB_OUTPUT
152+
echo "
153+
### npm audit
154+
155+
${{ steps.audit_report.outputs.result }}
156+
157+
### npm list
158+
159+
${{ steps.list_report.outputs.result }}
160+
" >> $GITHUB_OUTPUT
161+
echo "$delimiter" >> $GITHUB_OUTPUT
146162
147163
# Combine OSV, npm audit, and npm list output into a single comment
148164
- name: Add a comment containing OSV, npm audit, and npm list output
@@ -152,23 +168,10 @@ jobs:
152168
## Vulnerability results from base branch
153169
${{ steps.old.outputs.content }}
154170
155-
### npm audit
156-
157-
${{ steps.audit_report.outputs.result }}
158-
159-
### npm list
160-
161-
${{ steps.list_report.outputs.result }}
162-
171+
${{ steps.combined_report.outputs.result }}
163172
---
164173
165174
## Vulnerability results from current PR branch
166175
${{ steps.new.outputs.content }}
167176
168-
### npm audit
169-
170-
${{ steps.audit_report.outputs.result }}
171-
172-
### npm list
173-
174-
${{ steps.list_report.outputs.result }}
177+
${{ steps.combined_report.outputs.result }}

0 commit comments

Comments
 (0)