diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index e293017fae..9ff98cdbc2 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -116,7 +116,11 @@ jobs: continue-on-error: true if: always() id: slack_notification + env: + EVENT_COMMITS: ${{ toJson(github.event.commits[0].message) }} run: | + eventCommit=$(echo ${{env.EVENT_COMMITS}} | sed "s/'//g") + echo "slack_username=$(echo "$eventCommit" | awk -F '\\\\n' '{print $1}' | sed 's/^"//;s/"$//')" >> $GITHUB_ENV if [[ ${{ needs.ci-test.result }} == 'failure' ]]; then echo "slack_message=There are test failures in the run. Cypress Dashboard: " >> $GITHUB_OUTPUT echo "slack_color=#FF0000" >> $GITHUB_OUTPUT @@ -141,7 +145,7 @@ jobs: SLACK_ICON_EMOJI: ${{steps.slack_notification.outputs.slack_icon}} SLACK_ICON: https://app.slack.com/services/B05D17E4QVB SLACK_TITLE: "Result:" - SLACK_USERNAME: ${{ toJson(github.event.commits[0].message) | awk -F '\\\\n' '{print $1}' | sed 's/^"//;s/"$//' }} + SLACK_USERNAME: ${{steps.slack_notification.outputs.slack_username}} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_HOSTED }} MSG_MINIMAL: Ref,Event,Commit SLACK_FOOTER: "Push Workflow"