Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .github/workflows/reusable-check-built-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ jobs:
# - Builds Emoji files.
# - Builds bundled Root Certificate files.
# - Builds WordPress.
# - Checks for changes to versioned files.
# - Displays the result of git diff for debugging purposes.
# - Saves the diff to a patch file.
# - Checks for uncommitted changes.
# - Stages all uncommitted changes and adds any unversioned files.
# - Displays a diff of all staged changes.
# - Saves staged changes to a .diff file.
Comment on lines +28 to +31
# - Uploads the patch file as an artifact.
update-built-files:
name: Check and update built files
Expand Down Expand Up @@ -85,22 +86,26 @@ jobs:
- name: Build WordPress
run: npm run build:dev

- name: Check for changes to versioned files
- name: Check for uncommitted changes
id: built-file-check
run: |
if git diff --quiet; then
if [ -z "$(git status --porcelain)" ]; then
echo "uncommitted_changes=false" >> "$GITHUB_OUTPUT"
else
echo "uncommitted_changes=true" >> "$GITHUB_OUTPUT"
fi

- name: Display changes to versioned files
- name: Stage all changes for diff generation
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
run: git diff
run: git add -A

- name: Display all uncommitted changes
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
run: git diff --cached

- name: Save diff to a file
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
run: git diff > ./changes.diff
run: git diff --cached --binary > ./changes.diff

# Uploads the diff file as an artifact.
- name: Upload diff file as artifact
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/reusable-coding-standards-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# - Logs debug information about the GitHub Action runner.
# - Installs npm dependencies.
# - Run the WordPress JSHint checks.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
jshint:
name: JavaScript checks
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -57,5 +57,10 @@ jobs:
- name: Run JSHint
run: npm run grunt jshint

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-coding-standards-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# - Generate a report for displaying issues as pull request annotations.
# - Runs PHPCS on the `tests` directory without (warnings included).
# - Generate a report for displaying `test` directory issues as pull request annotations.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
phpcs:
name: PHP checks
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -104,5 +104,10 @@ jobs:
if: ${{ inputs.old-branch }}
run: phpcbf

- name: Ensure version-controlled files are not modified during the tests
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
# - Install additional languages.
# - Run the E2E tests.
# - Uploads screenshots and HTML snapshots as an artifact.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
e2e-tests:
name: SCRIPT_DEBUG ${{ inputs.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -153,5 +153,10 @@ jobs:
if-no-files-found: ignore
include-hidden-files: true

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# - Logs debug information about the GitHub Action runner.
# - Installs npm dependencies.
# - Run the WordPress QUnit tests.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
test-js:
name: Run QUnit tests
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -67,5 +67,10 @@ jobs:
- name: Run QUnit tests
run: npm run grunt qunit:compiled

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-javascript-type-checking-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# - Configures caching for TypeScript build info.
# - Runs JavaScript type checking.
# - Saves the TypeScript build info.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
typecheck:
name: Run JavaScript type checking
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -72,5 +72,10 @@ jobs:
*.tsbuildinfo
key: "ts-build-info-${{ github.run_id }}"

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-performance-test-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
# - Install MU plugin.
# - Run performance tests.
# - Archive artifacts.
# - Ensure version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
performance:
name: Test ${{ inputs.subject == 'base' && inputs.BASE_TAG || inputs.subject }}
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -272,5 +272,10 @@ jobs:
if-no-files-found: error
include-hidden-files: true

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
# - Set the base sha.
# - Set commit details.
# - Publish performance results.
# - Ensure version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
performance:
name: ${{ inputs.multisite && 'Multisite' || 'Single site' }} / ${{ inputs.memcached && 'Memcached' || 'Default' }}
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -353,5 +353,10 @@ jobs:
COMMITTED_AT="$(git show -s "$GITHUB_SHA" --format='%cI')"
node ./tests/performance/log-results.js "$CODEVITALS_PROJECT_TOKEN" trunk "$GITHUB_SHA" "$BASE_SHA" "$COMMITTED_AT" "$HOST_NAME"

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-php-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# - Make Composer packages available globally.
# - Runs the PHP compatibility tests.
# - Generate a report for displaying issues as pull request annotations.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
php-compatibility:
name: Run compatibility checks
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -86,5 +86,10 @@ jobs:
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./.cache/phpcs-compat-report.xml

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-phpstan-static-analysis-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# - Make Composer packages available globally.
# - Runs PHPStan static analysis (with Pull Request annotations).
# - Saves the PHPStan result cache.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
phpstan:
name: Run PHP static analysis
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -105,5 +105,10 @@ jobs:
path: .cache
key: "phpstan-result-cache-${{ github.run_id }}"

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-phpunit-tests-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
# - Logs debug information from inside the WordPress Docker container.
# - Install WordPress within the Docker container.
# - Run the PHPUnit tests.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
test-php:
name: PHP ${{ inputs.php }} / ${{ inputs.multisite && ' Multisite' || 'Single Site' }}${{ inputs.split_slow && ' slow tests' || '' }}${{ inputs.memcached && ' with memcached' || '' }}
runs-on: ${{ inputs.os }}
Expand Down Expand Up @@ -208,5 +208,10 @@ jobs:
if: ${{ ! inputs.split_slow }}
run: LOCAL_PHP_XDEBUG=true npm run "test:${PHPUNIT_SCRIPT}" -- -v --group xdebug --exclude-group __fakegroup__

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-phpunit-tests-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
# - Install WordPress within the Docker container.
# - Run the PHPUnit tests.
# - Upload the code coverage report to Codecov.io.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
# - Checks out the WordPress Test reporter repository.
# - Submit the test results to the WordPress.org host test results.
phpunit-tests:
Expand Down Expand Up @@ -268,8 +268,13 @@ jobs:
flags: ${{ inputs.multisite && 'multisite' || 'single' }},php
fail_ci_if_error: true

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi

- name: Checkout the WordPress Test Reporter
if: ${{ github.ref == 'refs/heads/trunk' && inputs.report }}
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/reusable-test-core-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ jobs:
# - Logs debug information about the GitHub Action runner.
# - Installs npm dependencies.
# - Builds WordPress to run from the desired location (src or build).
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes after building.
# - Creates a ZIP of the built WordPress files (when building to the build directory).
# - Cleans up after building WordPress.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes after cleaning.
# - Uploads the ZIP as a GitHub Actions artifact (when building to the build directory).
# - Saves the pull request number to a text file.
# - Uploads the pull request number as an artifact.
Expand Down Expand Up @@ -119,8 +119,13 @@ jobs:
- name: Build WordPress to run from ${{ inputs.directory }}
run: npm run ${{ inputs.directory == 'src' && 'build:dev' || 'build' }}

- name: Ensure version-controlled files are not modified or deleted during building
run: git diff --exit-code
- name: Check for uncommitted changes after building
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi

- name: Create ZIP of built files
if: ${{ inputs.directory == 'build' && contains( inputs.os, 'ubuntu-' ) }}
Expand All @@ -129,8 +134,13 @@ jobs:
- name: Clean after building to run from ${{ inputs.directory }}
run: npm run grunt ${{ inputs.directory == 'src' && 'clean -- --dev' || 'clean' }}

- name: Ensure version-controlled files are not modified or deleted during cleaning
run: git diff --exit-code
- name: Check for uncommitted changes after cleaning
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi

- name: Upload ZIP as a GitHub Actions artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/reusable-test-gutenberg-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# - Installs Core npm dependencies.
# - Builds WordPress to run from the relevant location (src or build).
# - Builds Gutenberg.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes after building.
build-process-tests:
name: ${{ contains( inputs.os, 'macos-' ) && 'MacOS' || contains( inputs.os, 'windows-' ) && 'Windows' || 'Linux' }}
permissions:
Expand Down Expand Up @@ -96,5 +96,10 @@ jobs:
run: npm run build
working-directory: ${{ env.GUTENBERG_DIRECTORY }}

- name: Ensure version-controlled files are not modified or deleted during building
run: git diff --exit-code
- name: Check for uncommitted changes after building
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
11 changes: 8 additions & 3 deletions .github/workflows/reusable-test-local-docker-environment-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
# - Runs a WP CLI command.
# - Tests the logs command.
# - Tests the reset command.
# - Ensures version-controlled files are not modified or deleted.
# - Checks for any uncommitted changes.
local-docker-environment-tests:
name: ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.memcached && ' with memcached' || '' }}${{ 'example.org' != inputs.tests-domain && format( ' {0}', inputs.tests-domain ) || '' }}
permissions:
Expand Down Expand Up @@ -166,5 +166,10 @@ jobs:
- name: Reset the Docker environment
run: npm run env:reset

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected:"
git status --porcelain
exit 1
fi
Loading
Loading