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 Nov 21, 2024
1 parent ebe3dfb commit 9ffc0bb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Publish packages on NPM
on:
release:
types: [created]
push:
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -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"
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: 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"'"
}'

0 comments on commit 9ffc0bb

Please sign in to comment.