Skip to content
Discussion options

You must be logged in to vote

Hey @ferdymercury! Unfortunately, GitHub doesn't currently offer a native way to restrict which merge button (Merge vs Squash and Merge) is available based on PR labels — the merge method enforcement in branch/repository rules applies globally to a branch, not conditionally per-label.

That said, here's a practical workaround using GitHub Actions that achieves the same goal: label-driven auto-merge via the API, so the merge method is enforced programmatically rather than through the UI.

Approach: Label-triggered auto-merge with the correct method

  1. Disable all merge methods except one in repo settings (or use a ruleset to block direct UI merges) so contributors can't click the button themse…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ferdymercury
Comment options

Answer selected by ferdymercury
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question Ask and answer questions about GitHub features and usage Workflow Configuration Topics about workflow files, YAML setup, job dependencies, and general workflow configuration issues Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates
3 participants