Fix ci slack notifications (only on main, not all branches) (#397)

Only notify #ci on Slack for 'main' branch.

Add token so workflow links work. From https://github.com/ravsamhq/notify-slack-action#readme:

> In order to use {workflow_url}, specify the token input as token: ${{ secrets.GITHUB_TOKEN }}.
This commit is contained in:
Sean Collins 2022-10-21 16:52:28 -04:00 committed by GitHub
parent e47fe2484e
commit 6f8c71ff5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -42,8 +42,9 @@ jobs:
- name: Run all tests
run: script/ci
- uses: ravsamhq/notify-slack-action@v1
if: always()
if: github.ref_name == 'main'
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>'