-
Notifications
You must be signed in to change notification settings - Fork 68
Add use-pr-linker workflow to auto-link PRs to issues #828
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
base: develop
Are you sure you want to change the base?
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,21 @@ | ||
| name: Auto link PR to Issues | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - opened | ||
| - edited | ||
| - synchronize | ||
| - reopened | ||
| - closed | ||
|
|
||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| call-linker: | ||
| uses: mosip/kattu/.github/workflows/link-pr-to-issue.yml@develop | ||
|
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. Pin the reusable workflow to an immutable commit SHA (avoid
Suggested change- uses: mosip/kattu/.github/workflows/link-pr-to-issue.yml@develop
+ uses: mosip/kattu/.github/workflows/link-pr-to-issue.yml@<full_commit_sha>🧰 Tools🪛 zizmor (1.25.2)[error] 19-19: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||
| secrets: | ||
| ACTION_PAT: ${{ secrets.ACTION_PAT }} | ||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: mosip/mosip-helm
Length of output: 3523
🏁 Script executed:
Repository: mosip/mosip-helm
Length of output: 237
🏁 Script executed:
Repository: mosip/mosip-helm
Length of output: 3093
🏁 Script executed:
Repository: mosip/mosip-helm
Length of output: 4090
🏁 Script executed:
Repository: mosip/mosip-helm
Length of output: 12598
Harden
pull_request_targetsecret usage:ACTION_PATcontract matches, but PR-derived issue refs can drive cross-repo API writes.use-pr-linker.ymlrunspull_request_targetand passessecrets.ACTION_PATto the reusable workflow’sworkflow_call.secrets.ACTION_PAT(required). The reusable workflow does not check out PR head content, but it parsesgithub.event.pull_request.title/bodyfor optional<owner>/<repo>#<n>references and uses the derivedREPO#/NUMBERdirectly in GitHub API calls to create/update/delete issue comments—so an attacker can steer comment modifications to any repo accessible by the PAT. Constrain/allowlistREPOto the base repo (or fixed repos) before making those API requests, and/or scope the PAT to only the allowed targets.File:
.github/workflows/use-pr-linker.yml(lines 4-5, 20-21)🤖 Prompt for AI Agents