Skip to content

Commit

Permalink
Merge pull request #67 from Clarifai/IN-1154
Browse files Browse the repository at this point in the history
[IN-1154] Add slack notification for failing workflows
  • Loading branch information
travertischio authored Sep 18, 2023
2 parents c9011e6 + d8ce6c6 commit a3495ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ jobs:
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Slack Notify
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_ICON: "https://raw.githubusercontent.com/github/explore/2c7e603b797535e5ad8b4beb575ab3b7354666e1/topics/actions/actions.png"
SLACK_USERNAME: "GitHub Alerts"
SLACK_CHANNEL: "#grpc-client-repo-alerts"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Publish failure"
SLACK_FOOTER: "Clarifai NodeJS GRPC Repo"

publish-github-release:
needs: publish-npm
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ jobs:
python scripts/app_and_key_for_tests.py --create-workflow ${CLARIFAI_API_KEY}
npm test
python scripts/app_and_key_for_tests.py --delete-app ${CLARIFAI_APP_ID}
- name: Slack Notify
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_ICON: "https://raw.githubusercontent.com/github/explore/2c7e603b797535e5ad8b4beb575ab3b7354666e1/topics/actions/actions.png"
SLACK_USERNAME: "GitHub Alerts"
SLACK_CHANNEL: "#grpc-client-repo-alerts"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Test failure"
SLACK_FOOTER: "Clarifai NodeJS GRPC Repo"

0 comments on commit a3495ad

Please sign in to comment.