diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index d75cc99eaf920..9342f2abc7f94 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -50,7 +50,14 @@ jobs: uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk permissions: contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) # Runs the JavaScript coding standards checks. jshint: @@ -58,7 +65,14 @@ jobs: uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk permissions: contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) slack-notifications: name: Slack Notifications diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index ee60975b39a0d..a7f6be21989f5 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -57,7 +57,14 @@ jobs: uses: WordPress/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@trunk permissions: contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) strategy: fail-fast: false matrix: diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 933bfcd5f8313..ec97fa07c45bd 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -53,7 +53,14 @@ jobs: uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk permissions: contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) slack-notifications: name: Slack Notifications diff --git a/.github/workflows/javascript-type-checking.yml b/.github/workflows/javascript-type-checking.yml index 940b48e25ae0a..b926821c1facc 100644 --- a/.github/workflows/javascript-type-checking.yml +++ b/.github/workflows/javascript-type-checking.yml @@ -46,7 +46,14 @@ jobs: uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-type-checking-v1.yml@trunk permissions: contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) slack-notifications: name: Slack Notifications diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index f9c86e7aaefae..ca94c45487305 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -50,7 +50,17 @@ jobs: determine-matrix: name: Determine Matrix runs-on: ubuntu-24.04 - if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }} + if: | + ( + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) + ) && + ! contains( github.event.before, '00000000' ) permissions: actions: read env: diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index 78f23bbcfe76d..c91a1652cbc55 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -42,7 +42,14 @@ jobs: uses: WordPress/wordpress-develop/.github/workflows/reusable-php-compatibility.yml@trunk permissions: contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) slack-notifications: name: Slack Notifications diff --git a/.github/workflows/phpstan-static-analysis.yml b/.github/workflows/phpstan-static-analysis.yml index 352b78e4c8f43..e1ab13c68a37d 100644 --- a/.github/workflows/phpstan-static-analysis.yml +++ b/.github/workflows/phpstan-static-analysis.yml @@ -42,7 +42,14 @@ jobs: uses: WordPress/wordpress-develop/.github/workflows/reusable-phpstan-static-analysis-v1.yml@trunk permissions: contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) slack-notifications: name: Slack Notifications diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index fb5da98d1e87c..99b2025e7c52a 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -58,7 +58,14 @@ jobs: uses: WordPress/wordpress-develop/.github/workflows/reusable-prepare-gutenberg.yml@trunk permissions: contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) # # Creates a PHPUnit test job for each PHP/MySQL combination. @@ -76,7 +83,16 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }} - if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }} + if: | + startsWith( github.repository, 'WordPress/' ) && ( + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) + ) strategy: fail-fast: false matrix: @@ -159,7 +175,16 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }} - if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }} + if: | + startsWith( github.repository, 'WordPress/' ) && ( + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) + ) strategy: fail-fast: false matrix: @@ -217,7 +242,16 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }} - if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }} + if: | + startsWith( github.repository, 'WordPress/' ) && ( + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) + ) strategy: fail-fast: false matrix: @@ -264,7 +298,16 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }} - if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }} + if: | + startsWith( github.repository, 'WordPress/' ) && ( + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) + ) strategy: fail-fast: false matrix: @@ -298,7 +341,13 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }} - if: ${{ ! startsWith( github.repository, 'WordPress/' ) && github.event_name == 'pull_request' }} + if: | + ! startsWith( github.repository, 'WordPress/' ) && + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) strategy: fail-fast: false matrix: diff --git a/.github/workflows/test-and-zip-default-themes.yml b/.github/workflows/test-and-zip-default-themes.yml index f50c00bdeafe9..30c15408f9736 100644 --- a/.github/workflows/test-and-zip-default-themes.yml +++ b/.github/workflows/test-and-zip-default-themes.yml @@ -69,7 +69,14 @@ jobs: permissions: contents: read timeout-minutes: 10 - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) strategy: fail-fast: false matrix: @@ -119,7 +126,14 @@ jobs: permissions: contents: read timeout-minutes: 10 - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) strategy: fail-fast: false matrix: diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index 64f6c63481914..be54536d7c6d3 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -51,7 +51,14 @@ jobs: uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk permissions: contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) strategy: fail-fast: false matrix: diff --git a/.github/workflows/upgrade-develop-testing.yml b/.github/workflows/upgrade-develop-testing.yml index b36b2c56b0d34..bc920a115321e 100644 --- a/.github/workflows/upgrade-develop-testing.yml +++ b/.github/workflows/upgrade-develop-testing.yml @@ -43,8 +43,17 @@ jobs: # Build WordPress from the current branch ready for the upgrade tests. build: name: Build - uses: WordPress/wordpress-develop/.github/workflows/reusable-build-package.yml@trunk - if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }} + uses: ./.github/workflows/reusable-build-package.yml + if: | + startsWith( github.repository, 'WordPress/' ) && ( + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) + ) permissions: contents: read @@ -86,8 +95,15 @@ jobs: # Run a limited set of upgrade tests for the current branch on forks. upgrade-tests-develop-forks: name: Upgrade from ${{ matrix.wp }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk - if: ${{ github.repository != 'WordPress/wordpress-develop' }} + uses: ./.github/workflows/reusable-upgrade-testing.yml + # This job also runs for the push event, which has no draft state to check. + if: | + github.repository != 'WordPress/wordpress-develop' && ( + github.event_name != 'pull_request' || + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) needs: [ build ] permissions: contents: read diff --git a/.github/workflows/workflow-lint.yml b/.github/workflows/workflow-lint.yml index d86b62ca79646..f04417964d6aa 100644 --- a/.github/workflows/workflow-lint.yml +++ b/.github/workflows/workflow-lint.yml @@ -32,8 +32,15 @@ permissions: {} jobs: lint: name: Lint GitHub Action files - uses: WordPress/wordpress-develop/.github/workflows/reusable-workflow-lint.yml@trunk - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + uses: ./.github/workflows/reusable-workflow-lint.yml + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) permissions: security-events: write actions: read