Skip to content

Commit

Permalink
Merge pull request #48 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 12423c1 + 8322574 commit d258a9c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ jobs:
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
- 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 Java GRPC Repo"

publish-github-release:
needs: publish-maven
name: Create Release
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 @@ -33,3 +33,14 @@ jobs:
python scripts/app_and_key_for_tests.py --create-workflow ${CLARIFAI_API_KEY}
./gradlew test --tests *Grpc*Test
./gradlew test --tests *Json*Test
- 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 Java GRPC Repo"

0 comments on commit d258a9c

Please sign in to comment.