Skip to content

Commit d781aa9

Browse files
committed
Old kubebuilder pr-verify does no long work. Replace.
Signed-off-by: Kurt Garloff <kurt@garloff.de>
1 parent b3680fb commit d781aa9

2 files changed

Lines changed: 42 additions & 24 deletions

File tree

.github/workflows/pr-verify.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/verifier.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "PR Title Verifier"
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
permissions: {}
8+
9+
jobs:
10+
verify:
11+
permissions:
12+
contents: read
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
persist-credentials: false
20+
21+
- name: Validate PR Title Format
22+
env:
23+
TITLE: ${{ github.event.pull_request.title }}
24+
run: |
25+
if [[ -z "$TITLE" ]]; then
26+
echo "Error: PR title cannot be empty."
27+
exit 1
28+
fi
29+
30+
if ! [[ "$TITLE" =~ ^($'\u26A0'|$'\u2728'|$'\U0001F41B'|$'\U0001F4D6'|$'\U0001F680'|$'\U0001F331') ]]; then
31+
echo "Error: Invalid PR title format."
32+
echo "Your PR title must start with one of the following indicators:"
33+
echo "- Breaking change: ⚠ (U+26A0)"
34+
echo "- Non-breaking feature: ✨ (U+2728)"
35+
echo "- Patch fix: 🐛 (U+1F41B)"
36+
echo "- Docs: 📖 (U+1F4D6)"
37+
echo "- Release: 🚀 (U+1F680)"
38+
echo "- Infra/Tests/Other: 🌱 (U+1F331)"
39+
exit 1
40+
fi
41+
42+
echo "PR title is valid: '$TITLE'"

0 commit comments

Comments
 (0)