Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit c8d579e

Browse files
authored
Don't send Slack notifications on manual IT runs (#896)
Add a condition to "Send Slack notification" steps to be triggered only if the job originated from a push to `main` branch (and not manual triggering of a job). Signed-off-by: Piotr Grabowski <[email protected]>
1 parent 6df9dc2 commit c8d579e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
run: go test -v
7171

7272
- name: Send Slack notification on failure
73-
if: failure()
73+
if: ${{ failure() && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
7474
uses: slackapi/[email protected]
7575
with:
7676
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
@@ -82,7 +82,7 @@ jobs:
8282
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
8383

8484
- name: Send Slack notification on success
85-
if: success()
85+
if: ${{ success() && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
8686
uses: slackapi/[email protected]
8787
with:
8888
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}

0 commit comments

Comments
 (0)