Skip to content

Commit

Permalink
Fix Slack bot for npm publish failure
Browse files Browse the repository at this point in the history
  • Loading branch information
lym953 committed Dec 19, 2024
1 parent 507e0d9 commit bfb9a97
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

notify:
runs-on: ubuntu-latest
needs: build
steps:
- name: Send success message to Slack
env:
SLACK_CHANNEL: "#serverless-onboarding-and-enablement-ops"
Expand All @@ -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: 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"'"
}'

0 comments on commit bfb9a97

Please sign in to comment.