You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a do not merge label that prevents merging #1684
Originally posted by Snailedlt October 4, 2022
Would it be useful to have a do not merge label?
Maybe the PR could have a job that fails if the label is applied too.
name: Do Not Mergeon:
pull_request:
types: [synchronize, opened, reopened, labeled, unlabeled]jobs:
do-not-merge:
if: ${{ contains(github.event.*.labels.*.name, 'do not merge') }}name: Prevent Mergingruns-on: ubuntu-lateststeps:
- name: Check for labelrun: | echo "Pull request is labeled as 'do not merge'" echo "This workflow fails so that the pull request cannot be merged" exit 1
How does setting this label differs from converting the PR to a draft? Number of clicks is about the same.
I usually use draft-PRs for this... not good to merge: is a draft PR.
It gets a special symbol (grey) when linked.
It can not be merged.
This feature also exists on gitlab, so ppl know this approach probably?
@Finii I thought only the author could change the PR to draft. If maintainers also can draft the PR this could work. Only downside I can see is that the author can change it back to a non-draft PR, while with labels only those with permission can do that.
The indication that something with the PR is amiss (can not be merged for some reason) with the grey symbol is quite nice.
Otoh, what do I know how you distribute rights etc. In less complex situations it works rather well; and usually it is not turned back to mark non-draft without a good reason and/or successful discussion etc.
Activity
Finii commentedon Sep 5, 2024
Just a comment from the off ;-)
How does setting this label differs from converting the PR to a draft? Number of clicks is about the same.
I usually use draft-PRs for this... not good to merge: is a draft PR.
This feature also exists on gitlab, so ppl know this approach probably?
Grey Draft-PR icon on github
PR list with 'do not merge' eerrr 'draft' status
Location of button in the sidebar ...
...while un-drafting is in the bottom 😬
Edit: Add button location images
Snailedlt commentedon Sep 5, 2024
@Finii I thought only the author could change the PR to draft. If maintainers also can draft the PR this could work. Only downside I can see is that the author can change it back to a non-draft PR, while with labels only those with permission can do that.
Thanks for the input :)
Finii commentedon Sep 6, 2024
At least I could change this PR to draft ;-)
The indication that something with the PR is amiss (can not be merged for some reason) with the grey symbol is quite nice.
Otoh, what do I know how you distribute rights etc. In less complex situations it works rather well; and usually it is not turned back to
mark non-draftwithout a good reason and/or successful discussion etc.Just wanted to point to that 👍
https://www.github.com/ryanoasis/nerd-fonts/pull/1666