Skip to content

Commit

Permalink
bug: escape quote in commit_message to prevent bash failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranf committed Sep 18, 2024
1 parent 4623574 commit 3205281
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
with:
token: ${{ secrets.SCRIBD_SLACK_GENERIC_TOKEN_PUBLIC }}
channel: test-release-notification
message: <https://scribd.com|Special characters + "quotes" + `backtick`>
message: <https://scribd.com|Special characters + 'single quote' + "double quotes" + `backtick`>
test-overwrite-repository:
runs-on: ubuntu-22.04
steps:
Expand Down
9 changes: 6 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ runs:
echo "emoji=large_orange_square" >> $GITHUB_OUTPUT
echo "color=warning" >> $GITHUB_OUTPUT
fi
if [ ! -z '${{ inputs.message }}' ]; then
message='${{ inputs.message }}'
input_message=$(cat <<-EOF
${{ inputs.message }}
EOF
)
if [ ! -z $input_message ]; then
message=$input_message
elif [ ! -z '${{ github.event.head_commit.message }}' ]; then
# get commit message from `push` trigger
commit_message=$(echo '${{ github.event.head_commit.message }}' | head -n 1)
Expand Down

0 comments on commit 3205281

Please sign in to comment.