-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): prevent merging PRs that do not meet minimum requirements (#…
- Loading branch information
1 parent
2a9c487
commit b2e43b3
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Fail PR check if do-not-merge label is present | ||
name: PR requirements | ||
|
||
# PROCESS | ||
# | ||
# 1. Verify whether 'do-not-merge' label is present | ||
# 2. Fail PR to prevent merging until resolved | ||
# 3. Pass PR if do-not-merge label is removed by a maintainer | ||
|
||
# USAGE | ||
# | ||
# Always triggered on PR labeling changes. | ||
|
||
# NOTES | ||
# | ||
# PR requirements are checked async in on_opened_pr.yml and enforced here synchronously | ||
# due to limitations in GH API. | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- labeled | ||
- unlabeled | ||
|
||
permissions: {} # no permission required | ||
|
||
jobs: | ||
fail-for-draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Block if it doesn't minimum requirements | ||
if: contains(github.event.pull_request.labels.*.name, 'do-not-merge') | ||
run: | | ||
echo "This PR does not meet minimum requirements (check PR comments)." | ||
exit 1 |