-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a CI check for do-not-merge label
- Loading branch information
Showing
1 changed file
with
22 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,22 @@ | ||
# This workflow fails if a 'do-not-merge' label is applied to the PR. | ||
name: Check do-not-merge | ||
|
||
on: | ||
pull_request: | ||
types: [reopened, labeled, unlabeled] | ||
# Runs on PRs to main and release branches | ||
branches: | ||
- main | ||
- release/** | ||
|
||
jobs: | ||
# checks that a do-not-merge label is not present for a PR | ||
do-not-merge-check: | ||
# If there is a `do-not-merge` label, or this comes from a fork (community contributor) we ignore this check | ||
if: ${{ (github.repository_owner == 'hashicorp' && contains(github.event.pull_request.labels.*.name, 'do-not-merge')) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fail if do-not-merge label is applied | ||
run: | | ||
echo "Cannot merge with do-not-merge label applied." | ||
exit 1 |