feat: Comment Audit result on PR (only on errors)#384
feat: Comment Audit result on PR (only on errors)#384eduardo-getpassport wants to merge 10 commits intojenstroeger:stagingfrom
Conversation
There was a problem hiding this comment.
Looks good to me, thank you @eduardo-getpassport! I have only three minor notes below that you can ignore if you’d like 😉
| path: . | ||
| if-no-files-found: error | ||
| retention-days: 1 | ||
| if: steps.audit-packages.outputs.exit_code == 1 |
There was a problem hiding this comment.
I wonder if steps.audit-packages.conclusion == 'failure' is more reliable because any non-zero exit code is considered a failure (and we check only for 1*)?
—————
* At first glance, 1 seems to be the only exit code that pip-audit returns.
|
@behnazh I’m actually surprised that referencing workflow steps works across different workflows (src) 🤔 I wasn’t able to find that documented, so hopefully that handy feature isn’t a bug. For example, in if: steps.audit-packages.outputs.exit_code == 1which references the |
Good point. I had missed it. Actually I doubt it works and will probably fail at runtime. @eduardo-getpassport have you tested these workflows? |
Yes! I just tested again. I commented on the After that I commenter the PR ones and works. I think since we are using the This is the first run with only the build commented: Link The second run with the if commented in both files: Link PS: Only on my runs, I commented the Mac and Windows jobs since we are expensive 😱 |
Fixed on separate branch, pushing the changes rn |
@eduardo-getpassport I'm trying to debug this. The |
|
With PR #551 in mind I wonder if it would make sense to post an informative message on a PR if package auditing is disabled? |
What's on this PR
pr-change-set.yaml:buildstep and post a comment with the output.build.yaml:continue-on-error: trueinAudit installed packagesstep . In case of an audit error, the next step will runaudit-packagesinAudit installed packagesstep. This is to reference this step in the later one.runcommand to export the output.What
Comment vulnerabilities on PRstep does:Takes the file generated in the previous step in case of an error and posts the content inside the PR.
Example: