From ba0899e10bae76a01351c0b84ce2da769a1ce97b Mon Sep 17 00:00:00 2001 From: Yiming Luo Date: Thu, 21 Nov 2024 15:17:20 -0500 Subject: [PATCH] Fix Slack bot for npm publish failure --- .github/workflows/publish.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 99ad8e80..4ce72a4a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,11 +16,6 @@ jobs: - run: yarn - run: yarn build - run: yarn publish - - notify: - runs-on: ubuntu-latest - needs: build - steps: - name: Send success message to Slack env: SLACK_CHANNEL: "#serverless-onboarding-and-enablement-ops" @@ -41,8 +36,9 @@ jobs: if: failure() run: | set -x - OPS_MESSAGE=":gh-check-passed: serverless-plugin-datadog NPM publish failed! + OPS_MESSAGE=":gh-check-failed: serverless-plugin-datadog NPM publish failed! Please check GitHub Action log: https://github.com/DataDog/serverless-plugin-datadog/actions/workflows/publish.yml" curl -H "Content-type: application/json" -X POST "$SLACK_WEBHOOK" -d '{ "channel": "'"$SLACK_CHANNEL"'", "text": "'"$OPS_MESSAGE"'" + }'