Skip to content

Commit 6b68d24

Browse files
committed
fix: escape commit messages
1 parent 3446062 commit 6b68d24

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

action.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,21 @@ inputs:
2727
runs:
2828
using: composite
2929
steps:
30+
- name: Set env (escaped)
31+
id: env
32+
shell: bash
33+
run: |
34+
{
35+
echo "commit_message<<EOF"
36+
echo "${{ github.event.head_commit.message }}"
37+
echo "EOF"
38+
} >> $GITHUB_ENV
39+
{
40+
echo "input_message<<EOF"
41+
echo "${{ inputs.message }}"
42+
echo "EOF"
43+
} >> $GITHUB_ENV
3044
- name: Set fields
31-
env:
32-
input_message: ${{ inputs.message }}
33-
commit_message: ${{ github.event.head_commit.message }}
3445
shell: bash
3546
if: always()
3647
id: fields
@@ -60,7 +71,11 @@ runs:
6071
commit_message="Link to the latest commit in the repository"
6172
message="<https://github.com/${{ inputs.repository }}/commit/${{ github.sha }}|$commit_message>"
6273
fi
63-
echo "message=$message" >> $GITHUB_OUTPUT
74+
{
75+
echo "message<<EOF"
76+
echo "$message"
77+
echo "EOF"
78+
} >> $GITHUB_OUTPUT
6479
6580
author=${{ github.event.pusher.name }} # context from `push` trigger
6681
author=${author:-${{ github.event.sender.login }}} # context from `workflow_dispatch` trigger

0 commit comments

Comments
 (0)