Skip to content

Commit

Permalink
Notify once
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed May 23, 2024
1 parent d5fd359 commit cd38b93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/actions/slack/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Slack Notification

description: 'Send slack notification'

inputs:
message:
description: 'Message to send'
Expand All @@ -10,6 +12,7 @@ inputs:
token:
description: 'Slack bot token'
required: true

runs:
using: "composite"
steps:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ jobs:
DD_ENV: ci
run: bundle exec rake spec

- if: ${{ success() }}
notify:
needs: test
runs-on: ubuntu-latest
steps:
- if: ${{ needs.test.result == 'success' }}
uses: ./.github/actions/slack
with:
message: ":tada: Tests passed!"
channel: ${{ vars.SLACK_CHANNEL_ID }}
token: ${{ secrets.SLACK_BOT_TOKEN }}

- if: ${{ failure() }}
- if: ${{ needs.test.result == 'failure' }}
uses: ./.github/actions/slack
with:
message: ":red-light: Tests failed!"
Expand Down

0 comments on commit cd38b93

Please sign in to comment.