From 2fb22c9b4cb77a219ec11fb017ab7550e43e017d Mon Sep 17 00:00:00 2001 From: saltydk Date: Fri, 24 Jan 2025 05:17:24 +0100 Subject: [PATCH] GHA: restrict notify to when we actually need it --- .github/workflows/notify.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index db9faafd5a..a32d5d146f 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -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