Skip to content

Commit

Permalink
Add a CI check for do-not-merge label (#27325)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalmi committed Jun 4, 2024
1 parent 1f64e6e commit e99e887
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/do-not-merge-checker.yml
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 we ignore this check
if: ${{ 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

0 comments on commit e99e887

Please sign in to comment.