Build/Test Tools: Escape $ within commit messages for `$variables.

This ensures the variables are preserved in the Slack message.

Props ocean90, desrosj.
See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51952 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2021-10-29 19:40:26 +00:00
parent ba6b4c4cd9
commit 5b1da06715

View File

@@ -110,7 +110,7 @@ jobs:
- name: Prepare commit message.
id: commit-message
run: |
COMMIT_MESSAGE=$(cat <<'EOF' | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\"/g'
COMMIT_MESSAGE=$(cat <<'EOF' | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\"/g' | sed 's/\$/\\$/g'
${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_commit.message || github.event.head_commit.message }}
EOF
)