fix: use --auto flag for merging PRs with branch protection#31
Conversation
When branch protection requires status checks, direct merge is blocked. The --auto flag queues the PR for merge once all checks pass. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 587841ea41
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| echo "Merging PR #$number with method $merge_method..." | ||
| gh pr merge "$number" -R "$REPO" "$merge_flag" --delete-branch --body "Merged automatically after successful CI." | ||
| gh pr merge "$number" -R "$REPO" "$merge_flag" --auto --delete-branch --body "Merged automatically after successful CI." |
There was a problem hiding this comment.
Don't mark
--auto PRs as merged before the merge happens
The GitHub CLI manual says gh pr merge --auto will merge "only after necessary requirements are met", so this command can succeed before the PR is actually on main. This workflow still sets merged_any=true immediately afterward, and .github/workflows/ci-pr.yml:74-114 uses that output to trigger workflow-compute-next-tag.yml and workflow-create-tag.yml, which check out main and tag its current HEAD. On protected branches where a required review/check is still pending, this will publish a tag/release from the pre-merge commit and report the PR as merged even if auto-merge never completes.
Useful? React with 👍 / 👎.
|
|
||
| echo "Merging PR #$number with method $merge_method..." | ||
| gh pr merge "$number" -R "$REPO" "$merge_flag" --delete-branch --body "Merged automatically after successful CI." | ||
| gh pr merge "$number" -R "$REPO" "$merge_flag" --auto --delete-branch --body "Merged automatically after successful CI." |
There was a problem hiding this comment.
Avoid requiring repository auto-merge for every reusable caller
GitHub's auto-merge docs require auto-merge to be enabled at the repository level before a PR can use --auto. Because this reusable workflow now passes --auto unconditionally, any consumer repo that has not turned on the separate "Allow auto-merge" setting will fail here even when the PR is otherwise ready to merge. Since README.md:50-73 advertises this workflow for general reuse, this change is a breaking regression for callers that previously worked with the plain gh pr merge path.
Useful? React with 👍 / 👎.
Summary
--autoflag togh pr mergein the reusable merge workflow--auto, GitHub queues the PR and merges it once all checks passTest plan
vinitu/my-conciergePR Fixes/release description #18 to verify auto-merge works🤖 Generated with Claude Code