Skip to content

Commit 51b64ac

Browse files
story645QuLogic
andcommitted
prevent merge on label [skip circle] [skip azp] [skip appveyor]
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent 3ad0bc5 commit 51b64ac

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/do_not_merge.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Do Not Merge
3+
4+
# action to block merging on specific labels
5+
on:
6+
pull_request:
7+
types: [synchronize, opened, reopened, labeled, unlabeled]
8+
9+
permissions: {}
10+
11+
jobs:
12+
do-not-merge:
13+
name: Prevent Merging
14+
runs-on: ubuntu-latest
15+
env:
16+
has_tag: >-
17+
${{contains(github.event.pull_request.labels.*.name, 'status: needs comment/discussion') ||
18+
contains(github.event.pull_request.labels.*.name, 'status: waiting for other PR')}}
19+
steps:
20+
- name: Check for label
21+
if: ${{'true' == env.has_tag}}
22+
run: |
23+
echo "This PR cannot be merged because it has one of the following labels: "
24+
echo "* status: needs comment/discussion"
25+
echo "* status: waiting for other PR"
26+
echo "${{env.has_tag}}"
27+
exit 1
28+
- name: Allow merging
29+
if: ${{'false' == env.has_tag}}
30+
run: exit 0
31+
- name: DEBUG
32+
run: |
33+
echo "${{env.has_tag}}"
34+
echo "${{toJson(github.event.pull_request.labels.*.name)}}"

0 commit comments

Comments
 (0)