Skip to content

ci: auto-merge the generated contributors PR - #627

Merged
moonD4rk merged 2 commits into
mainfrom
ci/contributors-auto-merge
Aug 2, 2026
Merged

ci: auto-merge the generated contributors PR#627
moonD4rk merged 2 commits into
mainfrom
ci/contributors-auto-merge

Conversation

@moonD4rk

@moonD4rk moonD4rk commented Aug 2, 2026

Copy link
Copy Markdown
Owner

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_id output the action already exposes.

  • Preconditions hold: the repo has allow_auto_merge: true, and the main ruleset sets required_approving_review_count: 0, so the PR merges the moment the 9 required checks pass.
  • Guarded by 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.
  • Same app installation token as the action; chore: update contributors list #626 already proved it has pull-requests: write.
  • Auto-merge rather than an outright merge keeps the gate intact: the 9 required checks still have to pass, and strict_required_status_checks_policy still forces the branch to be up to date first.
  • Values go through env: instead of being interpolated into run:, matching the pattern already used in release.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 to main.

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

  • Pull request targets the main branch
  • All CI checks pass (lint, test, build)
  • I have added tests that prove my fix is effective or that my feature works — N/A, workflow configuration only
  • I have added necessary documentation (if appropriate) — N/A
  • go.mod directive remains go 1.20 (do not bump)

https://claude.ai/code/session_01X6RUAuQYzireYCp9DTdtSm

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
Copilot AI review requested due to automatic review settings August 2, 2026 12:44
@codecov-commenter

codecov-commenter commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.24%. Comparing base (eed9d99) to head (71c5473).

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           
Flag Coverage Δ
unittests 73.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 id to the contributors action step so its pr_id output can be referenced.
  • Adds a follow-up step that runs gh pr merge ... --squash --auto to enable auto-merge for the generated PR when pr_id is present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@moonD4rk
moonD4rk merged commit df20f73 into main Aug 2, 2026
9 checks passed
@moonD4rk
moonD4rk deleted the ci/contributors-auto-merge branch August 2, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants