Skip to content

Commit

Permalink
chore: disable slack notification sending for forks (#9)
Browse files Browse the repository at this point in the history
# What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

Do not send Slack notification if the workflow is running from the fork
repository (external collaborators).

## Why ❔

For security reasons, GitHub restricts access to secrets for forks. So,
for the fork repository we just report workflow status in Github, but
Slack notification will not be sent.

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR.
- [x] Documentation comments have been added / updated.
  • Loading branch information
antonbaliasnikov authored Jun 3, 2024
1 parent 0d85f11 commit caf2d63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
- name: Send Slack notification
uses: 8398a7/action-slack@v3
if: ${{ failure() || success() }} # Skip canceled jobs
if: (failure() || success()) && (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork)
with:
status: ${{ job.status }}
fields: repo,commit,author,action,eventName,ref,workflow,job,took,pullRequest
Expand Down

0 comments on commit caf2d63

Please sign in to comment.