Skip to content

Commit

Permalink
feat(github): add prevent-merging action
Browse files Browse the repository at this point in the history
  • Loading branch information
prehor committed Oct 2, 2024
1 parent 934d6ab commit 46a063e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/prevent-merging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Prevent Merging"

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

jobs:
prevent-merging:
if: ${{ startsWith(github.event.*.labels.*.name, 'hold/') }}
name: Prevent Merging
runs-on: ubuntu-latest
steps:
- name: Check hold/* labels
run: |
echo "Pull request is labeled as 'hold/*'"
echo "This workflow fails so that the pull request cannot be merged"
exit 1

0 comments on commit 46a063e

Please sign in to comment.