From cec3f51542e00bdb3f7cdf504e619a0db7bc40b6 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 26 Sep 2024 22:55:09 +0000 Subject: [PATCH] Add condition to run job only on pull request failure events --- .github/workflows/genai-investigator.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/genai-investigator.yml b/.github/workflows/genai-investigator.yml index 7c4475e6fb..2986b4ad51 100644 --- a/.github/workflows/genai-investigator.yml +++ b/.github/workflows/genai-investigator.yml @@ -10,7 +10,9 @@ permissions: pull-requests: write jobs: check_failure: - if: ${{ github.event.workflow_run.conclusion == 'failure' }} + # Only run this job if the workflow run concluded with a failure + # and was triggered by a pull request event + if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4