Skip to content

Commit

Permalink
ci(repo): do not merge PR if "option.do-not-merge" is present (#17934)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Aug 16, 2024
1 parent e46cf29 commit 890e4fe
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/do-not-merge-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check for "option.do-not-merge" Label

on:
pull_request:
types: [labeled, unlabeled, synchronize, opened, reopened]

jobs:
check_label:
runs-on: ubuntu-latest
steps:
- name: Check for "option.do-not-merge" label
id: check_label
uses: actions/github-script@v6
with:
script: |
const labels = context.payload.pull_request.labels.map(label => label.name);
if (labels.includes("option.do-not-merge")) {
core.setFailed('The "option.do-not-merge" label is present. PR cannot be merged.');
}

0 comments on commit 890e4fe

Please sign in to comment.