From f06302bbb56c79b159cb497be8807599ce982d9b Mon Sep 17 00:00:00 2001 From: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com> Date: Fri, 26 Jul 2024 12:40:14 +0100 Subject: [PATCH] [testing workflows] Harden the run condition for reporting jobs to only run in the monorepo (#50017) --- .github/workflows/ci.yml | 6 +++--- .github/workflows/tests-daily-run.yml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fdc501032f..8a2b6272167 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -236,7 +236,7 @@ jobs: 'project-lint-jobs', 'project-test-jobs', ] - if: ${{ !cancelled() && github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork }} + if: ${{ !cancelled() && github.event_name != 'pull_request' && github.repository == 'woocommerce/woocommerce' }} steps: - uses: 'actions/checkout@v4' name: 'Checkout' @@ -273,7 +273,7 @@ jobs: 'project-jobs', 'project-test-jobs', ] - if: ${{ !cancelled() && needs.project-jobs.outputs.report-jobs != '[]' && ! github.event.pull_request.head.repo.fork }} + if: ${{ !cancelled() && needs.project-jobs.outputs.report-jobs != '[]' && github.repository == 'woocommerce/woocommerce' }} strategy: fail-fast: false matrix: @@ -330,7 +330,7 @@ jobs: report-flaky-tests: name: 'Create issues for flaky tests' - if: ${{ !cancelled() && ! github.event.pull_request.head.repo.fork && needs.project-jobs.outputs.test-jobs != '[]' }} + if: ${{ !cancelled() && github.repository == 'woocommerce/woocommerce' && needs.project-jobs.outputs.test-jobs != '[]' }} needs: [ 'project-jobs', diff --git a/.github/workflows/tests-daily-run.yml b/.github/workflows/tests-daily-run.yml index 581ec84543e..ccea88a5620 100644 --- a/.github/workflows/tests-daily-run.yml +++ b/.github/workflows/tests-daily-run.yml @@ -7,6 +7,7 @@ on: jobs: run-tests: name: 'Run tests' + if: github.repository == 'woocommerce/woocommerce' uses: ./.github/workflows/ci.yml with: trigger: 'daily-checks'