ci: auto-merge the generated contributors PR - #627
Merged
Conversation
Without it the bot PR sits until a human clicks merge, and every later push to main opens another duplicate — the action mints a fresh branch and PR each run with no dedup. Claude-Session: https://claude.ai/code/session_01X6RUAuQYzireYCp9DTdtSm
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #627 +/- ##
=======================================
Coverage 73.24% 73.24%
=======================================
Files 69 69
Lines 3184 3184
=======================================
Hits 2332 2332
Misses 628 628
Partials 224 224
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Contributors GitHub Actions workflow to automatically enable auto-merge for the PR opened by akhilmhdh/contributors-readme-action when it runs in protected-branch mode, removing the remaining manual “Squash and merge” step once required checks complete.
Changes:
- Assigns an
idto the contributors action step so itspr_idoutput can be referenced. - Adds a follow-up step that runs
gh pr merge ... --squash --autoto enable auto-merge for the generated PR whenpr_idis present.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
#626 is the first PR the Contributors workflow generated after #625, and it shows the one gap left: 9 checks green, no conflicts, and it still waits for a human to click Squash and merge.
This enables auto-merge on the generated PR via the
pr_idoutput the action already exposes.allow_auto_merge: true, and themainruleset setsrequired_approving_review_count: 0, so the PR merges the moment the 9 required checks pass.if: steps.contributors.outputs.pr_id != ''— the action only sets that output when the branch is protected and the README actually changed, so no-op runs skip the step.pull-requests: write.strict_required_status_checks_policystill forces the branch to be up to date first.env:instead of being interpolated intorun:, matching the pattern already used inrelease.yml.Beyond removing the manual click, this closes a duplicate-PR failure mode: the action mints a fresh
contributors-readme-action-*branch and a brand-new PR on every run with no dedup check, so an unmerged bot PR accumulates a sibling on each subsequent push tomain.Merge order matters — merge #626 first, then this PR. The other way round, this PR's own merge commit triggers Contributors while the README is still stale, opening a second contributors PR alongside #626.
Checklist
mainbranchgo 1.20(do not bump)https://claude.ai/code/session_01X6RUAuQYzireYCp9DTdtSm