diff --git a/.github/workflows/block-PR-with-no-merge-label.yml b/.github/workflows/block-PR-with-no-merge-label.yml new file mode 100644 index 00000000000..563cf905147 --- /dev/null +++ b/.github/workflows/block-PR-with-no-merge-label.yml @@ -0,0 +1,19 @@ +# .github/workflows/block-no-merge-label.yml +name: Block PRs with "NO-MERGE" label + +on: + pull_request: + types: [labeled, unlabeled, synchronize, opened, reopened] + +jobs: + check-label: + runs-on: ubuntu-latest + steps: + - name: Check for "NO-MERGE" label + uses: actions/github-script@v7 + with: + script: | + const labels = context.payload.pull_request.labels.map(label => label.name); + if (labels.includes("NO-MERGE")) { + core.setFailed("This pull request has a NO-MERGE label and cannot be merged."); + } \ No newline at end of file