Skip to content

Commit

Permalink
Update the initial Slack notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Perlence committed Dec 16, 2024
1 parent 49c10b8 commit 0b69bf1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ jobs:
color: '#ee9b00'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
outputs:
status_message_id: ${{ steps.slack.outputs.message_id }}

lint:
needs: [notify-build-start]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -51,12 +54,13 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
message_id: ${{ needs.notify-build-start.outputs.status_message_id }}
channel_id: C0PT3267R
status: FAILED
color: '#d7263d'

tests:
needs: lint
needs: [notify-build-start, lint]
runs-on: ubuntu-${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -162,13 +166,14 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
message_id: ${{ needs.notify-build-start.outputs.status_message_id }}
channel_id: C0PT3267R
status: FAILED
color: '#d7263d'

notify-build-success:
if: ${{ github.event_name == 'push' }}
needs: tests
needs: [notify-build-start, tests]
runs-on: ubuntu-latest
steps:
# Send notification on build success
Expand All @@ -177,6 +182,7 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
message_id: ${{ needs.notify-build-start.outputs.status_message_id }}
channel_id: C0PT3267R
status: SUCCESS
color: '#16db65'

0 comments on commit 0b69bf1

Please sign in to comment.