mirror of
https://github.com/google/nomulus
synced 2025-12-23 06:15:42 +00:00
Add a GitHub action to block merging based on the labels (#2367)
This commit is contained in:
23
.github/workflows/do-not-merge.yml
vendored
Normal file
23
.github/workflows/do-not-merge.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: "Check labels"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: ["master"]
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- labeled
|
||||||
|
- unlabeled
|
||||||
|
merge_group:
|
||||||
|
branches: ["master"]
|
||||||
|
types: [checks_requested]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
fail-by-label:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Fail if PR is labeled as "do not merge"
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'do not merge')
|
||||||
|
run: |
|
||||||
|
echo "This PR is labeled as do not merge!"
|
||||||
|
exit 1
|
||||||
Reference in New Issue
Block a user