Do not notify Slack if in PR

Notifying a Slack channel on regression test failures fails in a fork,
which is common for PRs. The failed Slack error is confusing, since it
disturbs from checking actual regression test failure. Furthermore,
notifying Slack is not needed in the case of PRs as developers rely on
GitHub's GUI around PRs. This commit fixes GH Actions workflows to not
notify Slack on PRs.
This commit is contained in:
Ruslan Fomkin 2021-02-23 11:22:09 +01:00 committed by Ruslan Fomkin
parent 06593a1c24
commit 7f9077dc8c
3 changed files with 3 additions and 3 deletions

View File

@ -83,7 +83,7 @@ jobs:
path: postgres.log
- name: Slack Notification
if: failure()
if: failure() && github.event_name != 'pull_request'
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: '#ff0000'

View File

@ -72,7 +72,7 @@ jobs:
fi
- name: Slack Notification
if: failure()
if: failure() && github.event_name != 'pull_request'
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: '#ff0000'

View File

@ -72,7 +72,7 @@ jobs:
fi
- name: Slack Notification
if: failure()
if: failure() && github.event_name != 'pull_request'
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: '#ff0000'