-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency Review ジョブが失敗したら、PR にコメントする #96
Conversation
inputs: | ||
comment-summary-in-pr: | ||
description: Determines if the summary is posted as a comment in the PR itself. Setting this to `always` or `on-failure` requires you to give the workflow the write permissions for pull-requests | ||
default: on-failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions/dependency-review-action のデフォルト never
です。
https://github.com/actions/dependency-review-action/blob/v4.5.0/README.md?plain=1#L113
route06/actions/.github/workflows/dependency_review.yml を使うと、デフォルトで PR にコメントしてくれますが、permissions の設定が必要になりました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 💬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMです 👍🏻
変更概要
.github/workflows/dependency_review.yml デフォルトで、PR にコメントするようにしました。
そのためにはユーザー側で permissions を設定する必要があるため、破壊的な変更とは言えないまでも、近い変更にはなっています。
背景
Dependency Review ジョブが失敗すると CI が落ちるので気づくことはできます。
ただ、"▶Vulnerabilities" をクリックしないと分かりません。
🔗 https://github.com/masutaka/sandbox/actions/runs/13430473078/job/37521109378
一方で Summary をクリックすると分かりやすい結果を確認できることは、気づくのが難しいです。
🔗 https://github.com/masutaka/sandbox/actions/runs/13430473078
別な話として、巨大な PR では脆弱性が見つかる以外で Dependency Review ジョブが失敗することがあります。
参考
こんな振る舞いだった。
braces
dependency and update lockfile masutaka/sandbox#104 (comment)1
のコメントが編集される1
のコメントはそのまま当該コードはこのあたり。
https://github.com/actions/dependency-review-action/blob/v4.5.0/src/comment-pr.ts#L41-L58