Repository navigation
feat(redirect-hotfix-pr): redirect Dependabot security PRs to the hotfix lane - #41
Merged
Merged
Conversation
…fix lane
Previously the redirect-hotfix-pr action skipped every bot-authored PR. That
meant Dependabot's security-update PRs — which need to ship quickly via the
hotfix lane, not the next-batch release — sat on `next` until someone manually
retargeted them.
The action now redirects on either of two triggers:
- Head branch matches the hotfix/security pattern (existing behavior).
- Author is `dependabot[bot]` AND the PR body contains a GHSA reference (a
`GHSA-xxxx-xxxx-xxxx` id or a `github.com/advisories/GHSA-…` URL). These
body markers are present on Dependabot's security PRs and absent on
routine version bumps, so the two paths cleanly separate.
Implementation:
- Adds `isDependabotSecurityPR({userLogin, prBody})` pure helper.
- `shouldSkip()` gains `userLogin` + `prBody` parameters and returns a new
`redirectKind` field ("hotfix" or "dependabot-security") so the caller
knows why the redirect happened.
- `buildCommentBody(oldBase, newBase, kind)` emits a kind-specific
explanatory comment (mentions the GHSA reference for security redirects).
- `main()` pulls user.login + body from the fetched PR — no new inputs.
- Test suite expanded from ~14 to 30 cases covering the new helper, all
shouldSkip branches with the new signature, and both comment kinds.
Docs updated in WORKFLOW-SETUP-GUIDE, AGENT-SCAFFOLDING, examples/README,
top-level README, and the example consumer hotfix-redirector.yml header.
…ession anchor' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
| if (userLogin !== "dependabot[bot]") return false; | ||
| if (!prBody) return false; | ||
| const ghsaId = /\bGHSA-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}\b/; | ||
| const advisoryUrl = /\bhttps?:\/\/github\.com\/advisories\/GHSA-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}\b/i; |
Shinrai
added a commit
that referenced
this pull request
May 26, 2026
…#40) ## 🚀 What's Changed ### 💥 Breaking Changes _No breaking changes_ ### ✨ Features - #41 (5fb9ffb) - feat(redirect-hotfix-pr): redirect Dependabot security PRs to the hotfix lane (c4e4c89) ### 🐛 Bug Fixes - #48 (7d06c21) - fix(changelog): drop merge commits from release-PR changelog (7ccdfde) - #47 (ff4207b) - fix(v4): prefer "Create a merge commit" on next/hotfixes; dedupe stacked-PR commits (c552494) - #44 - fix(v4): per-branch merge methods + PR-ref annotation in release-PR changelogs (29637d7) - fix(rulesets): move Copilot review next/hotfixes; allow squash as fallback (26dcea8) - fix(changelog): drop redundant precondition check in findAssociatedPullNumber (ea01889) - #41 (5fb9ffb) - Potential fix for pull request finding 'CodeQL / Missing regular expression anchor' (329f7fe) - #39 (91ddf1f) - fix(cla): audit tool walks both default and override signature trees (84ecbed) - fix(cla): pass public_cla_url_template through reusable workflow; document override behavior (97bb8d2) - fix(cla): bot reads CLA from ledger (default) or consumer override; per-text-hash scope (132bcb7) - fix(cla): remove root CLA.md; bot must use the central ledger as source (f01b007) ### 🔧 Other Changes - #46 (454b724) - docs(readme): modernize for v4; drop stale v3-launch markers; fix ruleset-generator links (d09fdb8) - #43 (417f110) - docs(embedded-tests): surface the embedded-tests-ci feature in onboarding (27a82f6) - #42 (47a9ee4) - chore(dependabot): add v4-tuned dependabot.yml template + update auto-merge wiring (d52b60e) - #39 (91ddf1f) - docs(cla): describe override scope across all onboarding + reference docs (7a25d06) - #38 (9527fef) - docs(cla): reframe public sample CLA, drop mirror-of-private framing (549263a) - chore(cla): seed real CLA text + add boilerplate files (730a90e) <details> <summary>👥 Contributors</summary> - @Shinrai </details> --------- Co-authored-by: Nate Corcoran <[email protected]> Co-authored-by: cldmv-bot[bot] <230771808+cldmv-bot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 What's Changed
💥 Breaking Changes
No breaking changes
✨ Features
🐛 Bug Fixes
🔧 Other Changes
No other changes
👥 Contributors