Skip to content

Commit

Permalink
github: Prevent merging (fail CI) if 'freeze' label exists for PR
Browse files Browse the repository at this point in the history
Mostly useful duging the freeze period to warn the maintainers from merging
unwanted PRs.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
  • Loading branch information
ton31337 committed Jan 25, 2023
1 parent 9ffd150 commit a228215
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/freeze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Warn before merging if a "freeze" label exists

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

jobs:
freeze_warning:
if: ${{ contains(github.event.*.labels.*.name, 'freeze') }}
name: Warn before merging if a "freeze" label exists
runs-on: ubuntu-latest
steps:
- name: Check for "freeze" label
run: |
echo "Pull request is labeled as 'freeze'"
echo "This workflow fails so that the pull request cannot be merged."
exit 1

0 comments on commit a228215

Please sign in to comment.