devicon icon indicating copy to clipboard operation
devicon copied to clipboard

Add a `do not merge` label that prevents merging

Open Snailedlt opened this issue 2 years ago • 3 comments

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

Snailedlt avatar Feb 18 '23 16:02 Snailedlt

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?

image

Grey Draft-PR icon on github

image

PR list with 'do not merge' eerrr 'draft' status

image

Location of button in the sidebar ...

image

...while un-drafting is in the bottom :grimacing:

Edit: Add button location images

Finii avatar Sep 05 '24 09:09 Finii

@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 :)

Snailedlt avatar Sep 05 '24 13:09 Snailedlt

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:

image

https://www.github.com/ryanoasis/nerd-fonts/pull/1666

Finii avatar Sep 06 '24 14:09 Finii