-
Notifications
You must be signed in to change notification settings - Fork 0
fix: use --auto flag for merging PRs with branch protection #31
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
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 |
|---|---|---|
|
|
@@ -131,7 +131,7 @@ jobs: | |
| fi | ||
|
|
||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
GitHub's auto-merge docs require auto-merge to be enabled at the repository level before a PR can use Useful? React with 👍 / 👎. |
||
|
|
||
| merged_any="true" | ||
| entry=$(jq -n --arg number "$number" --arg head "$head" --arg title "$title" --arg author "$author" '{number:$number,head:$head,title:$title,author:$author}') | ||
|
|
||
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.
--autoPRs as merged before the merge happensThe GitHub CLI manual says
gh pr merge --autowill merge "only after necessary requirements are met", so this command can succeed before the PR is actually onmain. This workflow still setsmerged_any=trueimmediately afterward, and.github/workflows/ci-pr.yml:74-114uses that output to triggerworkflow-compute-next-tag.ymlandworkflow-create-tag.yml, which check outmainand 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 👍 / 👎.