Add a `do not merge` label that prevents merging
Discussed in https://github.com/devicons/devicon/discussions/1429
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.
Example implementation from here: https://www.jessesquires.com/blog/2021/08/24/useful-label-based-github-actions-workflows/#updated-21-march-2022
name: Do Not Merge
on:
pull_request:
types: [synchronize, opened, reopened, labeled, unlabeled]
jobs:
do-not-merge:
if: ${{ contains(github.event.*.labels.*.name, 'do not merge') }}
name: Prevent Merging
runs-on: ubuntu-latest
steps:
- name: Check for label
run: |
echo "Pull request is labeled as 'do not merge'"
echo "This workflow fails so that the pull request cannot be merged"
exit 1
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.
- 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?
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 :grimacing:
Edit: Add button location images
@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 :)
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-draft without a good reason and/or successful discussion etc.
Just wanted to point to that :+1:
https://www.github.com/ryanoasis/nerd-fonts/pull/1666