@@ -18,22 +18,16 @@ jobs:
1818 - name : Checkout
1919 uses : actions/checkout@v4
2020
21- # 1) Capture PR Body as Base64 (so special chars won't break the shell)
2221 - name : Write PR Body to File
23- env :
24- BODY_B64 : ${{ github.event.pull_request.body | toBase64 }}
2522 run : |
26- # Disable history expansion just in case
23+ # Disable history expansion so lines with '!' or '- [x]' won't be interpreted
2724 set +H
2825 set +o histexpand
2926
30- # Decode the base64 into pr_body.txt
31- echo "$BODY_B64" | base64 --decode > pr_body.txt
27+ echo "Saving the PR body to pr_body.txt..."
28+ # Write the entire multi-line body verbatim
29+ printf '%s\n' "${{ github.event.pull_request.body }}" > pr_body.txt
3230
33- echo "Saved PR body to pr_body.txt:"
34- cat pr_body.txt
35-
36- # 2) Determine Single Label
3731 - name : Determine Single Label
3832 id : determine_label
3933 run : |
@@ -42,12 +36,15 @@ jobs:
4236 # 1) Bugfix
4337 if grep -qE '^- \\[x\\] Bugfix' pr_body.txt; then
4438 label="bugfix"
39+
4540 # 2) New feature
4641 elif grep -qE '^- \\[x\\] New feature' pr_body.txt; then
4742 label="new-feature"
43+
4844 # 3) Breaking change
4945 elif grep -qE '^- \\[x\\] Breaking change' pr_body.txt; then
5046 label="breaking-change"
47+
5148 # 4) Dependency update
5249 elif grep -qE '^- \\[x\\] Dependency Update - Does not publish' pr_body.txt; then
5350 label="dependency-update"
5653 echo "Chosen label: $label"
5754 echo "chosen_label=$label" >> $GITHUB_OUTPUT
5855
59- # 3) Apply Single Label (if chosen)
6056 - name : Apply Single Label
6157 if : ${{ steps.determine_label.outputs.chosen_label != '' }}
6258 uses : actions-ecosystem/action-add-labels@v1
0 commit comments