From b0c89e6e957017c7652b8d6db639c7ea6af7f23d Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 11 Mar 2024 09:36:02 +0000 Subject: [PATCH] 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. --- .github/actions/send-notification/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/send-notification/action.yml b/.github/actions/send-notification/action.yml index eef0a1c039..9582d44ed1 100644 --- a/.github/actions/send-notification/action.yml +++ b/.github/actions/send-notification/action.yml @@ -22,12 +22,12 @@ runs: - shell: bash if: ${{ inputs.status == 'success' }} run: | - 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 + 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 - shell: bash if: ${{ inputs.status == 'failure' }} run: | - curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: " *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true + curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: " *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true - shell: bash if: ${{ inputs.status == 'cancelled' }} run: | - curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true + curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true