Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ rules:
languages:
- yaml
severity: ERROR
message: 'pull_request_target is considered very risky and should only be used when strictly needed. Please
prefer other triggers when possible. If you think this is needed, you can dismiss this alert and
merge your PR. More information: https://google.github.io/github-team/semgrep-rules/pull-request-target-needs-exception.html'
message: 'pull_request_target is a high-risk event and should only be used in exceptional cases.
Please choose a safer trigger whenever possible.
If you are certain this workflow requires pull_request_target, you may dismiss this alert and proceed with the merge.
For more details, see: https://google.github.io/github-team/semgrep-rules/pull-request-target-needs-exception.html'
Comment on lines +6 to +9

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The new message is much clearer. However, by using a single-quoted string ('...'), the newlines will be folded into spaces, resulting in a single long line of text. If you intend for the message to have line breaks for better readability in the Semgrep output, you should use a literal block scalar (|). This will preserve the newlines and make the message easier to read. The trailing double spaces at the end of sentences are also no longer necessary with this change.

    message: |
      pull_request_target is a high-risk event and should only be used in exceptional cases.
      Please choose a safer trigger whenever possible.
      If you are certain this workflow requires pull_request_target, you may dismiss this alert and proceed with the merge.
      For more details, see: https://google.github.io/github-team/semgrep-rules/pull-request-target-needs-exception.html

metadata:
category: best-practice
technology:
Expand Down