Skip to content

Commit b2e43b3

Browse files
authored
chore(ci): prevent merging PRs that do not meet minimum requirements (#2639)
1 parent 2a9c487 commit b2e43b3

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/on_pr_updates.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Fail PR check if do-not-merge label is present
2+
name: PR requirements
3+
4+
# PROCESS
5+
#
6+
# 1. Verify whether 'do-not-merge' label is present
7+
# 2. Fail PR to prevent merging until resolved
8+
# 3. Pass PR if do-not-merge label is removed by a maintainer
9+
10+
# USAGE
11+
#
12+
# Always triggered on PR labeling changes.
13+
14+
# NOTES
15+
#
16+
# PR requirements are checked async in on_opened_pr.yml and enforced here synchronously
17+
# due to limitations in GH API.
18+
19+
on:
20+
pull_request:
21+
types:
22+
- opened
23+
- labeled
24+
- unlabeled
25+
26+
permissions: {} # no permission required
27+
28+
jobs:
29+
fail-for-draft:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Block if it doesn't minimum requirements
33+
if: contains(github.event.pull_request.labels.*.name, 'do-not-merge')
34+
run: |
35+
echo "This PR does not meet minimum requirements (check PR comments)."
36+
exit 1

0 commit comments

Comments
 (0)