Skip to content

Commit ca90830

Browse files
committed
🌱 use env: to set variable. Otherwise quoting issues.
If the title contains quotes, the currrent GitHub Action will fail to run.
1 parent 3f3be65 commit ca90830

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/verify.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313
uses: actions/checkout@v4
1414

1515
- name: Validate PR Title Format
16+
env:
17+
TITLE: ${{ github.event.pull_request.title }}
1618
run: |
17-
TITLE="${{ github.event.pull_request.title }}"
18-
1919
if [[ -z "$TITLE" ]]; then
2020
echo "Error: PR title cannot be empty."
2121
exit 1
2222
fi
23-
23+
2424
if ! [[ "$TITLE" =~ ^($'\u26A0'|$'\u2728'|$'\U0001F41B'|$'\U0001F4D6'|$'\U0001F680'|$'\U0001F331') ]]; then
2525
echo "Error: Invalid PR title format."
2626
echo "Your PR title must start with one of the following indicators:"
@@ -32,5 +32,5 @@ jobs:
3232
echo "- Infra/Tests/Other: 🌱 (U+1F331)"
3333
exit 1
3434
fi
35-
35+
3636
echo "PR title is valid: '$TITLE'"

0 commit comments

Comments
 (0)