Skip to content

Commit 5b730d7

Browse files
authored
Replace deprecated kubebuilder-release-tools PR verifier with inline scripts (#210)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
1 parent 011e26c commit 5b730d7

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

.github/workflows/pr-verify.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
name: PR Verifier
22

33
on:
4-
# NB: using `pull_request_target` runs this in the context of
5-
# the base repository, so it has permission to upload to the checks API.
6-
# This means changes won't kick in to this file until merged onto the
7-
# main branch.
8-
pull_request_target:
4+
pull_request:
95
types: [opened, edited, reopened, synchronize]
106

117
jobs:
@@ -17,7 +13,25 @@ jobs:
1713
runs-on: ubuntu-latest
1814
steps:
1915
- name: Verifier action
20-
id: verifier
21-
uses: kubernetes-sigs/kubebuilder-release-tools@v0.3.0
22-
with:
23-
github_token: ${{ secrets.GITHUB_TOKEN }}
16+
env:
17+
TITLE: ${{ github.event.pull_request.title }}
18+
run: |
19+
if [[ -z "$TITLE" ]]; then
20+
echo "Error: PR title cannot be empty."
21+
exit 1
22+
fi
23+
24+
if ! [[ "$TITLE" =~ ^(:sparkles:|:bug:|:book:|:memo:|:warning:|:seedling:|:question:|$'\u2728'|$'\U0001F41B'|$'\U0001F4D6'|$'\U0001F4DD'|$'\u26A0'$'\uFE0F'?|$'\U0001F331'|$'\u2753') ]]; then
25+
echo "Error: Invalid PR title format."
26+
echo "Your PR title must start with one of the following indicators:"
27+
echo "- :sparkles: ✨ feature"
28+
echo "- :bug: 🐛 bug fix"
29+
echo "- :book: 📖 docs"
30+
echo "- :memo: 📝 proposal"
31+
echo "- :warning: ⚠️ breaking change"
32+
echo "- :seedling: 🌱 other/misc"
33+
echo "- :question: ❓ requires manual review"
34+
exit 1
35+
fi
36+
37+
echo "PR title is valid: '$TITLE'"

0 commit comments

Comments
 (0)