Skip to content

Commit

Permalink
github: Mark the build as failed if 'do not merge' label is set
Browse files Browse the repository at this point in the history
This prevents us from merging PRs marked as 'do not merge'.

Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Dec 22, 2023
1 parent eba1c1e commit c733a38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/freeze.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Warn before merging if a "freeze" label exists
name: Warn before merging if a "freeze" or "do not merge" 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
if: ${{ contains(github.event.*.labels.*.name, 'freeze') || contains(github.event.*.labels.*.name, 'do not merge') }}
name: Warn before merging if a "freeze" or "do not merge" label exists
runs-on: ubuntu-latest
steps:
- name: Check for "freeze" label
run: |
echo "Pull request is labeled as 'freeze'"
echo "Pull request is labeled as 'freeze' or 'do not merge'"
echo "This workflow fails so that the pull request cannot be merged."
exit 1

0 comments on commit c733a38

Please sign in to comment.