Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 126dc77

Browse filesBrowse files
authored
Merge pull request #27668 from story645/do-not-merge
MNT: prevent merging using labels + branch protection rules
2 parents 48c065e + 7333228 commit 126dc77
Copy full SHA for 126dc77

File tree

Expand file treeCollapse file tree

1 file changed

+30
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+30
-0
lines changed

‎.github/workflows/do_not_merge.yml

Copy file name to clipboard
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.