Skip to content

Commit

Permalink
feat(ci): add a check to make sure there's no hold label on the PR (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jan 30, 2024
1 parent f4473af commit 1f5ae74
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/no-hold-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Hold Label Check

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

jobs:
check-hold-label:
runs-on: ubuntu-latest
steps:
- name: Check for 'hold' label
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const payload = context.payload.pull_request
const holdLabelPresent = !!payload.labels.find(label => label.name.includes('hold'))
if (holdLabelPresent) {
core.setFailed('Hold label is present, merge is blocked.')
}

0 comments on commit 1f5ae74

Please sign in to comment.