Skip to content

chore(dependabot): bump github.com/thomaspoignant/go-feature-flag from 1.33.0 to 1.40.0 #1223

chore(dependabot): bump github.com/thomaspoignant/go-feature-flag from 1.33.0 to 1.40.0

chore(dependabot): bump github.com/thomaspoignant/go-feature-flag from 1.33.0 to 1.40.0 #1223

name: Block mergings PRs if it contains a blocking label (do-not-merge, hold)
on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- reopened
permissions:
contents: read
pull-requests: read
checks: write
jobs:
fail-for-labels:
runs-on: ubuntu-latest
steps:
- name: Block if PR has specific labels
uses: actions/github-script@v7
with:
script: |
const pullNumber = context.payload.pull_request.number;
const { data: pullRequest } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pullNumber,
});
const blockingKeywords = ["do-not-merge", "hold"];
pullRequest.labels.forEach(label =>
blockingKeywords.forEach(blockingKeyword => {
if(label.name.includes(blockingKeyword)) {
console.log(`Blocking merge due to blocking label "${blockingKeyword}"`);
throw new Error('Merging is blocked because this PR contains a blocking label.');
}
})
)
console.log(`No blocking labels found for PR ${pullNumber}`);