Skip to content

chore(ci): prevent merging PRs that do not meet minimum requirements #2639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/on_pr_updates.yml
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