Skip to content

Commit 70eaecb

Browse files
committed
fix: webhook proper escape
1 parent d4122f2 commit 70eaecb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/webhook.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Get commit and file details
1919
id: commit
2020
run: |
21-
COMMITS_JSON=$(git log --oneline ${{ github.event.before }}..${{ github.event.after }} --pretty=format:'{"sha":"%h","message":"%s","author":"%an","full_message":"%B"}' | jq -s .)
21+
COMMITS_JSON=$(git log --oneline ${{ github.event.before }}..${{ github.event.after }} --format='%h%x00%an%x00%s%x00%B%x00' | jq -R -s 'split("\x00") | map(select(. != "")) as $lines | [range(0; $lines | length; 4) as $i | $lines[$i:$i+4]] | map({sha: .[0], author: .[1], message: .[2], full_message: .[3]}) | .')
2222
2323
echo "commits_json=$COMMITS_JSON" >> $GITHUB_OUTPUT
2424
@@ -47,4 +47,4 @@ jobs:
4747
env:
4848
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
4949
COMMITS_JSON: ${{ steps.commit.outputs.commits_json }}
50-
FILE_COUNT: ${{ steps.changed-files.outputs.changed_files_count }}
50+
FILE_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }}

0 commit comments

Comments
 (0)