Skip to content

Commit

Permalink
chore(repo): add github action to prevent merging PRs that are not re…
Browse files Browse the repository at this point in the history
…ady yet (#15822)
  • Loading branch information
AgentEnder authored Mar 22, 2023
1 parent b230af2 commit ac20983
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/do-not-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Unmergable Labels Check

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

jobs:
do-not-merge:
name: Prevent Merging
runs-on: ubuntu-latest
steps:
- name: Check for label
run: |
echo "${{ toJSON(github.event.*.labels.*.name) }}"
node -e 'const forbidden = ["target: next major version", "PR Status: needs tests", "PR Status: in-progress", "blocked: needs rebase"];
const match = ${{ toJSON(github.event.*.labels.*.name) }}.find(l => forbidden.includes(l));
if (match) {
console.log("Cannot merge PRs that are labeled with " + match);
process.exit(1)
}'

0 comments on commit ac20983

Please sign in to comment.