Skip to content

Commit

Permalink
ci: fix escaping for Slack failure notifications (#19838)
Browse files Browse the repository at this point in the history
Allow '()', '#', and other bash-interpretable special characters by
properly quoting the commit message when shortening.
  • Loading branch information
zalimeni authored Dec 6, 2023
1 parent 04d4412 commit 3a78446
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a78446

Please sign in to comment.