Skip to content

Commit 4356ed9

Browse files
test: support do-not-merge label
Support do-not-merge label for PR. PR can't be merged if this label is set. The use cases of this label are to prohibit PRs that are needs to be rebased or squashed. Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
1 parent 7e25f99 commit 4356ed9

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Check Do Not Merge Label
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled, unlabeled]
6+
7+
jobs:
8+
check-label:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check for do-not-merge label
12+
run: |
13+
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'do-not-merge') }}" == "true" ]]; then
14+
echo "::error::This PR has the 'do-not-merge' label and cannot be merged"
15+
exit 1
16+
fi
17+
echo "No blocking labels found"

0 commit comments

Comments
 (0)