-
Notifications
You must be signed in to change notification settings - Fork 1
Add comment to newly opened PR #27
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,18 @@ | ||||||||||||||||||
| name: Add Comment to PR | ||||||||||||||||||
|
|
||||||||||||||||||
| on: | ||||||||||||||||||
| pull_request_target: | ||||||||||||||||||
| types: | ||||||||||||||||||
| - opened | ||||||||||||||||||
|
|
||||||||||||||||||
| jobs: | ||||||||||||||||||
| comment: | ||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||
|
|
||||||||||||||||||
| steps: | ||||||||||||||||||
| - name: Create or Update Comment | ||||||||||||||||||
| uses: peter-evans/[email protected] | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainPin the third-party action to a commit SHA. Using a floating tag (even v4.0.0) risks supply-chain drift. Pin to the exact commit for v4.0.0 and optionally add an allowlist comment. Apply this diff after resolving the release’s commit SHA: - uses: peter-evans/[email protected]
+ # v4.0.0 (pin to immutable commit for supply-chain safety)
+ uses: peter-evans/create-or-update-comment@<commit-sha-for-v4.0.0>Use one of the commands below to retrieve the exact commit SHA for v4.0.0: 🏁 Script executed: #!/bin/bash
# Get the commit SHA for the v4.0.0 tag (select the commit, not the tag object)
git ls-remote https://github.com/peter-evans/create-or-update-comment refs/tags/v4.0.0 | awk 'END{print $1}'Length of output: 151 Pin GitHub Action to immutable commit SHA The • File: Suggested diff: - uses: peter-evans/[email protected]
+ # v4.0.0 (pin to immutable commit for supply-chain safety)
+ uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043📝 Committable suggestion
Suggested change
|
||||||||||||||||||
| with: | ||||||||||||||||||
| issue-number: ${{ github.event.pull_request.number }} | ||||||||||||||||||
| body: | | ||||||||||||||||||
| Hi @${{ github.event.pull_request.user.login }}! Thank you for the contribution. | ||||||||||||||||||
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.
🛠️ Refactor suggestion
Harden the GITHUB_TOKEN scope (least privilege).
pull_request_target grants a broad, write-scoped token by default. This job only needs to read contents and write an issue-style comment. Restrict permissions at the workflow root.
Apply this diff to set minimal permissions:
🤖 Prompt for AI Agents