ci: fix escaping for Slack failure notifications (#19838)

Allow '()', '#', and other bash-interpretable special characters by
properly quoting the commit message when shortening.
This commit is contained in:
Michael Zalimeni 2023-12-06 16:00:30 -05:00 committed by GitHub
parent 04d4412afd
commit 3a78446114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -513,7 +513,7 @@ jobs:
if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure)\"'; then
printf "Tests failed, notifying Slack"
echo "FAILED_TESTS=true" >> $GITHUB_ENV
echo "COMMIT_MESSAGE_SUMMARY=$(echo ${{ github.event.head_commit.message }} | head -n 1)" >> $GITHUB_ENV
echo "COMMIT_MESSAGE_SUMMARY=$(echo '${{ github.event.head_commit.message }}' | head -n 1)" >> $GITHUB_ENV
fi
- name: Notify Slack
# failure() ensures this runs even if the test eval step exits 1