Skip to content

Commit

Permalink
Add "Do Not Merge" GH Action to block PRs with "DO-NOT-MERGE" label (#…
Browse files Browse the repository at this point in the history
…18724)

* gh action: do-not-merge

* gh action: do-not-merge update

* gh action: Do Not Merge - use github.event.pull_request

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

---------

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
  • Loading branch information
digiwand and Gudahtt authored Apr 21, 2023
1 parent 0efd00b commit 7617a44
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/do-not-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Fails the pull request if it has the "DO-NOT-MERGE" label

name: Check "DO-NOT-MERGE" label

on:
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]

jobs:
do-not-merge:
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'DO-NOT-MERGE') }}
steps:
- name: 'Check for label "DO-NOT-MERGE"'
run: |
echo 'This check fails PRs with the "DO-NOT-MERGE" label to block merging'
exit 1

0 comments on commit 7617a44

Please sign in to comment.