Skip to content

Commit 66dc97a

Browse files
authored
🌱 Fix/fix pr verify (#227)
* Use kubebuilder-pr-verify directly rather than -release-tools. The latter is outdated and included a reference to grc.io that broke. So use directly a working container. * Fix syntax. * Old pr-verify won't work any more. Follow advice from https://github.com/kubernetes-sigs/kubebuilder-release-tools#pr-verification-github-action-deprecated Signed-off-by: Kurt Garloff <kurt@garloff.de>
1 parent 800cac6 commit 66dc97a

2 files changed

Lines changed: 42 additions & 70 deletions

File tree

β€Ž.github/workflows/pr-verify.ymlβ€Ž

Lines changed: 0 additions & 70 deletions
This file was deleted.
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)