From 4f822c094ea2ab295a7e475471f80aac3dbd4a37 Mon Sep 17 00:00:00 2001 From: Rajat Parashar Date: Thu, 15 Jul 2021 01:48:15 +0530 Subject: [PATCH] fix: action failure on invalid String in BASH --- .github/workflows/deployBlocker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployBlocker.yml b/.github/workflows/deployBlocker.yml index f2f6995c74d4..fcbcdf9c5aa6 100644 --- a/.github/workflows/deployBlocker.yml +++ b/.github/workflows/deployBlocker.yml @@ -31,7 +31,7 @@ jobs: run: | echo "DEPLOY_BLOCKER_URL=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV echo "DEPLOY_BLOCKER_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV - echo "DEPLOY_BLOCKER_TITLE=${{ github.event.pull_request.title }}" >> $GITHUB_ENV + echo "DEPLOY_BLOCKER_TITLE=$(sed -e "s/'/'\\\\''/g; s/\`/\\\\\`/g; 1s/^/'/; \$s/\$/'/" <<< ${{ github.event.pull_request.title }})" >> $GITHUB_ENV - name: Update StagingDeployCash with new deploy blocker uses: Expensify/Expensify.cash/.github/actions/createOrUpdateStagingDeploy@main @@ -54,7 +54,7 @@ jobs: channel: '#deployer', attachments: [{ color: "#DB4545", - text: '💥 New E.cash Deploy Blocker: <${{ env.DEPLOY_BLOCKER_URL }}|${{ env.DEPLOY_BLOCKER_TITLE }}>', + text: '💥 New E.cash Deploy Blocker: <${{ env.DEPLOY_BLOCKER_URL }}|'+ `${{ env.DEPLOY_BLOCKER_TITLE }}`.replace(/(^'|'$)/gi, '').replace(/'\''/gi,'\'') + '>', }] } env: