[testing workflows] Harden the run condition for reporting jobs to only run in the monorepo (#50017)

This commit is contained in:
Adrian Moldovan 2024-07-26 12:40:14 +01:00 committed by GitHub
parent 406cc67c47
commit f06302bbb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -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',

View File

@ -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'