From 44f24c38d6c11e47aa7bb73b1f88bf0fead64397 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Wed, 13 Nov 2024 20:08:28 +0100 Subject: [PATCH 1/6] Switch to using local references for reusable workflows. --- .github/workflows/coding-standards.yml | 6 +++--- .github/workflows/end-to-end-tests.yml | 4 ++-- .github/workflows/install-testing.yml | 2 +- .github/workflows/javascript-tests.yml | 4 ++-- .github/workflows/performance.yml | 4 ++-- .github/workflows/php-compatibility.yml | 4 ++-- .github/workflows/phpunit-tests.yml | 6 +++--- .github/workflows/test-and-zip-default-themes.yml | 2 +- .github/workflows/test-build-processes.yml | 10 +++++----- .github/workflows/test-coverage.yml | 4 ++-- .github/workflows/test-old-branches.yml | 2 +- .github/workflows/upgrade-testing.yml | 14 +++++++------- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 3c9854dc9e16b..9d68d091e91ac 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -49,7 +49,7 @@ jobs: # Runs the PHP coding standards checks. phpcs: name: PHP coding standards - uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk + uses: ./.github/workflows/reusable-coding-standards-php.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} @@ -57,14 +57,14 @@ jobs: # Runs the JavaScript coding standards checks. jshint: name: JavaScript coding standards - uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk + uses: ./.github/workflows/reusable-coding-standards-javascript.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index d77e439b2964c..fe516381eb5c1 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -38,7 +38,7 @@ jobs: # Runs the end-to-end test suite. e2e-tests: name: Test with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@trunk + uses: ./.github/workflows/reusable-end-to-end-tests.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} @@ -51,7 +51,7 @@ jobs: slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/install-testing.yml b/.github/workflows/install-testing.yml index fd63f665aea4c..4d3f83e83125b 100644 --- a/.github/workflows/install-testing.yml +++ b/.github/workflows/install-testing.yml @@ -172,7 +172,7 @@ jobs: slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 5872bc5b166c0..e2766e6fa83d1 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -47,14 +47,14 @@ jobs: # Runs the WordPress Core JavaScript tests. test-js: name: QUnit Tests - uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk + uses: ./.github/workflows/reusable-javascript-tests.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index e4929763afa83..53030fea66370 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -33,7 +33,7 @@ jobs: # Runs the performance test suite. performance: name: Performance tests ${{ matrix.memcached && '(with memcached)' || '' }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-performance.yml@trunk + uses: ./.github/workflows/reusable-performance.yml permissions: contents: read if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }} @@ -48,7 +48,7 @@ jobs: slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index eb4163edf38d5..3dbd97b7be732 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -44,14 +44,14 @@ jobs: # Runs PHP compatibility testing. php-compatibility: name: Check PHP compatibility - uses: WordPress/wordpress-develop/.github/workflows/reusable-php-compatibility.yml@trunk + uses: ./.github/workflows/reusable-php-compatibility.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 949e08d5339ca..8a98e1491e75a 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -36,7 +36,7 @@ jobs: # test-with-mysql: name: PHP ${{ matrix.php }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v3.yml@trunk + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml permissions: contents: read secrets: inherit @@ -115,7 +115,7 @@ jobs: # test-with-mariadb: name: PHP ${{ matrix.php }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v3.yml@trunk + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml permissions: contents: read secrets: inherit @@ -156,7 +156,7 @@ jobs: slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/test-and-zip-default-themes.yml b/.github/workflows/test-and-zip-default-themes.yml index c7e7b3012f8f9..8a68016a3156b 100644 --- a/.github/workflows/test-and-zip-default-themes.yml +++ b/.github/workflows/test-and-zip-default-themes.yml @@ -198,7 +198,7 @@ jobs: slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index a7b6e2f924650..bd0acbb4567b3 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -31,7 +31,7 @@ jobs: # Tests the WordPress Core build process on multiple operating systems. test-core-build-process: name: Core running from ${{ matrix.directory }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk + uses: ./.github/workflows/reusable-test-core-build-process.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} @@ -63,7 +63,7 @@ jobs: # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. test-core-build-process-macos: name: Core running from ${{ matrix.directory }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk + uses: ./.github/workflows/reusable-test-core-build-process.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' }} @@ -79,7 +79,7 @@ jobs: # Tests the Gutenberg plugin build process on multiple operating systems when run within a wordpress-develop checkout. test-gutenberg-build-process: name: Gutenberg running from ${{ matrix.directory }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-test-gutenberg-build-process.yml@trunk + uses: ./.github/workflows/reusable-test-gutenberg-build-process.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} @@ -102,7 +102,7 @@ jobs: # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. test-gutenberg-build-process-macos: name: Gutenberg running from ${{ matrix.directory }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-test-gutenberg-build-process.yml@trunk + uses: ./.github/workflows/reusable-test-gutenberg-build-process.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' }} @@ -117,7 +117,7 @@ jobs: slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 3240671b8a29e..4ddfdeae80882 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -49,7 +49,7 @@ jobs: # test-coverage-report: name: ${{ matrix.multisite && 'Multisite' || 'Single site' }} report - uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v3.yml@trunk + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' }} @@ -67,7 +67,7 @@ jobs: slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/test-old-branches.yml b/.github/workflows/test-old-branches.yml index be554bdc149dc..2c9a7a6e36fa7 100644 --- a/.github/workflows/test-old-branches.yml +++ b/.github/workflows/test-old-branches.yml @@ -125,7 +125,7 @@ jobs: slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index b14108468f46c..ee5d4a551bd4b 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -35,7 +35,7 @@ jobs: # Spawns upgrade testing from WordPress 6.x versions on PHP 8.x with MySQL. upgrade-tests-wp-6x-php-8x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk + uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} permissions: contents: read @@ -61,7 +61,7 @@ jobs: # Spawns upgrade testing from WordPress 6.x versions on PHP 7.x with MySQL. upgrade-tests-wp-6x-php-7x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk + uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} permissions: contents: read @@ -92,7 +92,7 @@ jobs: # Spawns upgrade testing from WordPress 5.x versions on PHP 7.x with MySQL. upgrade-tests-wp-5x-php-7x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk + uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} strategy: fail-fast: false @@ -125,7 +125,7 @@ jobs: # - array/string offset with curly braces. upgrade-tests-wp-5x-php-8x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk + uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} strategy: fail-fast: false @@ -148,7 +148,7 @@ jobs: # Spawns upgrade testing from WordPress 4.x versions on PHP 7.x with MySQL. upgrade-tests-wp-4x-php-7x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk + uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} strategy: fail-fast: false @@ -181,7 +181,7 @@ jobs: # - array/string offset with curly braces. upgrade-tests-wp-4x-php-8x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk + uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} strategy: fail-fast: false @@ -203,7 +203,7 @@ jobs: slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read From a558195552b0e4e423125b218719616e97696d4e Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 14 Nov 2024 09:37:11 -0500 Subject: [PATCH 2/6] Manipulate the PHP workflow. --- .github/workflows/reusable-phpunit-tests-v3.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 56e40e762cd27..c878ddfe1f719 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -120,6 +120,20 @@ jobs: with: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} + - name: Checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} + repository: 'docker-library/php' + path: some-bad-folder + + - name: Upload HTML coverage report as artifact + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + with: + name: wp-code-coverage${{ inputs.multisite && '-multisite' || '-single' }}-${{ github.sha }} + path: some-bad-folder + overwrite: true + - name: Set up Node.js uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: @@ -220,7 +234,7 @@ jobs: with: name: wp-code-coverage${{ inputs.multisite && '-multisite' || '-single' }}-${{ github.sha }} path: wp-code-coverage${{ inputs.multisite && '-multisite' || '-single' }}-${{ github.sha }} - overwrite: true + overwrite: false - name: Ensure version-controlled files are not modified or deleted run: git diff --exit-code From c2cd0511020bc9c9d332e1e73247132f2aee148b Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 14 Nov 2024 10:02:49 -0500 Subject: [PATCH 3/6] Revert "Manipulate the PHP workflow." This reverts commit a558195552b0e4e423125b218719616e97696d4e. --- .github/workflows/reusable-phpunit-tests-v3.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index c878ddfe1f719..56e40e762cd27 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -120,20 +120,6 @@ jobs: with: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - repository: 'docker-library/php' - path: some-bad-folder - - - name: Upload HTML coverage report as artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: wp-code-coverage${{ inputs.multisite && '-multisite' || '-single' }}-${{ github.sha }} - path: some-bad-folder - overwrite: true - - name: Set up Node.js uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: @@ -234,7 +220,7 @@ jobs: with: name: wp-code-coverage${{ inputs.multisite && '-multisite' || '-single' }}-${{ github.sha }} path: wp-code-coverage${{ inputs.multisite && '-multisite' || '-single' }}-${{ github.sha }} - overwrite: false + overwrite: true - name: Ensure version-controlled files are not modified or deleted run: git diff --exit-code From aaec4dfe0e8b97e99f9503757a867583501fa50d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 20 Jan 2025 16:30:26 +0000 Subject: [PATCH 4/6] Switch to local references for some more workflows. --- .github/workflows/install-testing.yml | 2 +- .github/workflows/local-docker-environment.yml | 6 +++--- .github/workflows/phpunit-tests.yml | 4 ++-- .github/workflows/upgrade-testing.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/install-testing.yml b/.github/workflows/install-testing.yml index 7505a1d5eaa9e..4f3a79aa8fe1f 100644 --- a/.github/workflows/install-testing.yml +++ b/.github/workflows/install-testing.yml @@ -43,7 +43,7 @@ jobs: # Determines the supported values for PHP and database versions based on the WordPress version being tested. build-test-matrix: name: Build Test Matrix - uses: WordPress/wordpress-develop/.github/workflows/reusable-support-json-reader-v1.yml@trunk + uses: ./.github/workflows/reusable-support-json-reader-v1.yml permissions: contents: read secrets: inherit diff --git a/.github/workflows/local-docker-environment.yml b/.github/workflows/local-docker-environment.yml index 09b212e90ead5..61676269b170c 100644 --- a/.github/workflows/local-docker-environment.yml +++ b/.github/workflows/local-docker-environment.yml @@ -63,7 +63,7 @@ jobs: # build-test-matrix: name: Build Test Matrix - uses: WordPress/wordpress-develop/.github/workflows/reusable-support-json-reader-v1.yml@trunk + uses: ./.github/workflows/reusable-support-json-reader-v1.yml permissions: contents: read secrets: inherit @@ -74,7 +74,7 @@ jobs: # Tests the local Docker environment. environment-tests-mysql: name: PHP ${{ matrix.php }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-test-local-docker-environment-v1.yml@trunk + uses: ./.github/workflows/reusable-test-local-docker-environment-v1.yml permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} @@ -108,7 +108,7 @@ jobs: slack-notifications: name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index bf301882e20bb..8c5e3257222bf 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -157,7 +157,7 @@ jobs: # test-innovation-releases: name: PHP ${{ matrix.php }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v3.yml@trunk + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml permissions: contents: read secrets: inherit @@ -200,7 +200,7 @@ jobs: # specific-test-groups: name: ${{ matrix.phpunit-test-groups }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v3.yml@trunk + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml permissions: contents: read secrets: inherit diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index 6839b73a5a0c4..81037ba371c1b 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -245,7 +245,7 @@ jobs: # the full list of PHP/MySQL combinations. upgrade-tests-oldest-wp-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk + uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} strategy: fail-fast: false From 2ae1f86f1848d098a94bd3a10eab615cb579966f Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 20 Jan 2025 17:06:55 +0000 Subject: [PATCH 5/6] Add commands for switching from local to remote trunk references for the workflow files (and back again). --- Gruntfile.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index 4f8a3d6aa2e76..241c87eb412ae 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -456,6 +456,28 @@ module.exports = function(grunt) { } ); } } + }, + 'workflow-references-local-to-remote': { + options: { + processContent: function( src ) { + return src.replace( /uses: \.\/\.github\/workflows\/([^\.]+)\.yml/g, function( match, $1, $2, $3 ) { + return 'uses: WordPress/wordpress-develop/.github/workflows/' + $1 + '.yml@trunk'; + } ); + } + }, + src: '.github/workflows/*.yml', + dest: './' + }, + 'workflow-references-remote-to-local': { + options: { + processContent: function( src ) { + return src.replace( /uses: WordPress\/wordpress-develop\/\.github\/workflows\/([^\.]+)\.yml@trunk/g, function( match, $1, $2, $3 ) { + return 'uses: ./.github/workflows/' + $1 + '.yml'; + } ); + } + }, + src: '.github/workflows/*.yml', + dest: './' } }, sass: { @@ -1513,6 +1535,14 @@ module.exports = function(grunt) { 'copy:version', ] ); + grunt.registerTask( 'replace:workflow-references-local-to-remote', [ + 'copy:workflow-references-local-to-remote', + ]); + + grunt.registerTask( 'replace:workflow-references-remote-to-local', [ + 'copy:workflow-references-remote-to-local', + ]); + /** * Build verification tasks. */ From 138155012712b3e8adf26bf778c7094776042f42 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 20 Jan 2025 17:15:05 +0000 Subject: [PATCH 6/6] Coding standards. --- Gruntfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 241c87eb412ae..10b3bcfbabb8d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -460,7 +460,7 @@ module.exports = function(grunt) { 'workflow-references-local-to-remote': { options: { processContent: function( src ) { - return src.replace( /uses: \.\/\.github\/workflows\/([^\.]+)\.yml/g, function( match, $1, $2, $3 ) { + return src.replace( /uses: \.\/\.github\/workflows\/([^\.]+)\.yml/g, function( match, $1 ) { return 'uses: WordPress/wordpress-develop/.github/workflows/' + $1 + '.yml@trunk'; } ); } @@ -471,7 +471,7 @@ module.exports = function(grunt) { 'workflow-references-remote-to-local': { options: { processContent: function( src ) { - return src.replace( /uses: WordPress\/wordpress-develop\/\.github\/workflows\/([^\.]+)\.yml@trunk/g, function( match, $1, $2, $3 ) { + return src.replace( /uses: WordPress\/wordpress-develop\/\.github\/workflows\/([^\.]+)\.yml@trunk/g, function( match, $1 ) { return 'uses: ./.github/workflows/' + $1 + '.yml'; } ); }