Skip to content

Commit b0c89e6

Browse files
committed
Quote the URL used to send Google Chat notifications
The URL may contain special characters that are misinterpreted by the shell. This can be avoided by quoting it, thereby passing it into curl as-is.
1 parent c671d2a commit b0c89e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/actions/send-notification/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ runs:
2222
- shell: bash
2323
if: ${{ inputs.status == 'success' }}
2424
run: |
25-
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true
25+
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true
2626
- shell: bash
2727
if: ${{ inputs.status == 'failure' }}
2828
run: |
29-
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true
29+
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true
3030
- shell: bash
3131
if: ${{ inputs.status == 'cancelled' }}
3232
run: |
33-
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true
33+
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true

0 commit comments

Comments
 (0)