Skip to content

Commit

Permalink
GHA: restrict notify to when we actually need it
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Jan 24, 2025
1 parent f7d2080 commit 2fb22c9
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,13 @@ permissions:
jobs:
notify:
runs-on: ubuntu-24.04
if: github.event.repository.fork == false
if: github.event.repository.fork == false && (github.event.workflow_run.conclusion == 'success' || (github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.run_attempt >= 3) || github.event.workflow_run.conclusion == 'cancelled')
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'requirements/requirements-notify.txt'

- name: Install dependencies
run: pip install -r requirements/requirements-notify.txt

- name: Send notification
env:
GITHUB_TOKEN: ${{ github.token }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
run: |
python .github/scripts/notify.py
run: python .github/scripts/notify.py

0 comments on commit 2fb22c9

Please sign in to comment.