github: Prevent merging (fail CI) if 'freeze' label exists for PR

Mostly useful duging the freeze period to warn the maintainers from merging
unwanted PRs.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2023-01-25 10:43:55 +02:00
parent 9ffd15013a
commit a228215b00
1 changed files with 17 additions and 0 deletions

17
.github/workflows/freeze.yml vendored Normal file
View File

@ -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