From 9ffc0bbfd04906b79d31b958faee1f49db725886 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 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 99ad8e80..1292b7e0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,6 +2,7 @@ name: Publish packages on NPM on: release: types: [created] + push: jobs: build: runs-on: ubuntu-latest @@ -16,11 +17,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 +37,9 @@ jobs: if: failure() run: | set -x - OPS_MESSAGE=":gh-check-passed: serverless-plugin-datadog NPM publish failed! + OPS_MESSAGE=":gh-check-failed: YIMING TEST 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"'" + }'