Skip to content

Commit 63151ca

Browse files
committed
Check for new files everywhere.
1 parent 55d6ce8 commit 63151ca

15 files changed

Lines changed: 120 additions & 49 deletions

.github/workflows/reusable-check-built-files.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ jobs:
2424
# - Builds Emoji files.
2525
# - Builds bundled Root Certificate files.
2626
# - Builds WordPress.
27-
# - Checks for changes to versioned files.
28-
# - Displays the result of git diff for debugging purposes.
29-
# - Saves the diff to a patch file.
27+
# - Checks for uncommitted changes.
28+
# - Stages all uncommitted changes and adds any unversioned files.
29+
# - Displays a diff of all staged changes.
30+
# - Saves staged changes to a .diff file.
3031
# - Uploads the patch file as an artifact.
3132
update-built-files:
3233
name: Check and update built files
@@ -78,7 +79,7 @@ jobs:
7879
- name: Build WordPress
7980
run: npm run build:dev
8081

81-
- name: Check for changes to versioned files
82+
- name: Check for uncommitted changes
8283
id: built-file-check
8384
run: |
8485
if [ -z "$(git status --porcelain)" ]; then
@@ -91,7 +92,7 @@ jobs:
9192
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
9293
run: git add -A
9394

94-
- name: Display changes to versioned files
95+
- name: Display all uncommitted changes
9596
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
9697
run: git diff --cached
9798

.github/workflows/reusable-coding-standards-javascript.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# - Logs debug information about the GitHub Action runner.
2525
# - Installs npm dependencies.
2626
# - Run the WordPress JSHint checks.
27-
# - Ensures version-controlled files are not modified or deleted.
27+
# - Checks for any uncommitted changes.
2828
jshint:
2929
name: JavaScript checks
3030
runs-on: ubuntu-24.04
@@ -57,5 +57,10 @@ jobs:
5757
- name: Run JSHint
5858
run: npm run grunt jshint
5959

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

.github/workflows/reusable-coding-standards-php.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
# - Generate a report for displaying issues as pull request annotations.
3737
# - Runs PHPCS on the `tests` directory without (warnings included).
3838
# - Generate a report for displaying `test` directory issues as pull request annotations.
39-
# - Ensures version-controlled files are not modified or deleted.
39+
# - Checks for any uncommitted changes.
4040
phpcs:
4141
name: PHP checks
4242
runs-on: ubuntu-24.04
@@ -104,5 +104,10 @@ jobs:
104104
if: ${{ inputs.old-branch }}
105105
run: phpcbf
106106

107-
- name: Ensure version-controlled files are not modified during the tests
108-
run: git diff --exit-code
107+
- name: Check for uncommitted changes
108+
run: |
109+
if [ -n "$(git status --porcelain)" ]; then
110+
echo "Uncommitted changes detected:"
111+
git status --porcelain
112+
exit 1
113+
fi

.github/workflows/reusable-end-to-end-tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
# - Install additional languages.
6262
# - Run the E2E tests.
6363
# - Uploads screenshots and HTML snapshots as an artifact.
64-
# - Ensures version-controlled files are not modified or deleted.
64+
# - Checks for any uncommitted changes.
6565
e2e-tests:
6666
name: SCRIPT_DEBUG ${{ inputs.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
6767
runs-on: ubuntu-24.04
@@ -153,5 +153,10 @@ jobs:
153153
if-no-files-found: ignore
154154
include-hidden-files: true
155155

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

.github/workflows/reusable-javascript-tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
# - Logs debug information about the GitHub Action runner.
2626
# - Installs npm dependencies.
2727
# - Run the WordPress QUnit tests.
28-
# - Ensures version-controlled files are not modified or deleted.
28+
# - Checks for any uncommitted changes.
2929
test-js:
3030
name: Run QUnit tests
3131
runs-on: ubuntu-24.04
@@ -67,5 +67,10 @@ jobs:
6767
- name: Run QUnit tests
6868
run: npm run grunt qunit:compiled
6969

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

.github/workflows/reusable-javascript-type-checking-v1.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
# - Configures caching for TypeScript build info.
2424
# - Runs JavaScript type checking.
2525
# - Saves the TypeScript build info.
26-
# - Ensures version-controlled files are not modified or deleted.
26+
# - Checks for any uncommitted changes.
2727
typecheck:
2828
name: Run JavaScript type checking
2929
runs-on: ubuntu-24.04
@@ -72,5 +72,10 @@ jobs:
7272
*.tsbuildinfo
7373
key: "ts-build-info-${{ github.run_id }}"
7474

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

.github/workflows/reusable-performance-test-v2.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
# - Install MU plugin.
103103
# - Run performance tests.
104104
# - Archive artifacts.
105-
# - Ensure version-controlled files are not modified or deleted.
105+
# - Checks for any uncommitted changes.
106106
performance:
107107
name: Test ${{ inputs.subject == 'base' && inputs.BASE_TAG || inputs.subject }}
108108
runs-on: ubuntu-24.04
@@ -272,5 +272,10 @@ jobs:
272272
if-no-files-found: error
273273
include-hidden-files: true
274274

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

.github/workflows/reusable-php-compatibility.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# - Make Composer packages available globally.
3131
# - Runs the PHP compatibility tests.
3232
# - Generate a report for displaying issues as pull request annotations.
33-
# - Ensures version-controlled files are not modified or deleted.
33+
# - Checks for any uncommitted changes.
3434
php-compatibility:
3535
name: Run compatibility checks
3636
runs-on: ubuntu-24.04
@@ -86,5 +86,10 @@ jobs:
8686
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
8787
run: cs2pr ./.cache/phpcs-compat-report.xml
8888

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

.github/workflows/reusable-phpstan-static-analysis-v1.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# - Make Composer packages available globally.
3131
# - Runs PHPStan static analysis (with Pull Request annotations).
3232
# - Saves the PHPStan result cache.
33-
# - Ensures version-controlled files are not modified or deleted.
33+
# - Checks for any uncommitted changes.
3434
phpstan:
3535
name: Run PHP static analysis
3636
runs-on: ubuntu-24.04
@@ -99,5 +99,10 @@ jobs:
9999
path: .cache
100100
key: "phpstan-result-cache-${{ github.run_id }}"
101101

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

.github/workflows/reusable-phpunit-tests-v2.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
# - Logs debug information from inside the WordPress Docker container.
8585
# - Install WordPress within the Docker container.
8686
# - Run the PHPUnit tests.
87-
# - Ensures version-controlled files are not modified or deleted.
87+
# - Checks for any uncommitted changes.
8888
test-php:
8989
name: PHP ${{ inputs.php }} / ${{ inputs.multisite && ' Multisite' || 'Single Site' }}${{ inputs.split_slow && ' slow tests' || '' }}${{ inputs.memcached && ' with memcached' || '' }}
9090
runs-on: ${{ inputs.os }}
@@ -208,5 +208,10 @@ jobs:
208208
if: ${{ ! inputs.split_slow }}
209209
run: LOCAL_PHP_XDEBUG=true npm run "test:${PHPUNIT_SCRIPT}" -- -v --group xdebug --exclude-group __fakegroup__
210210

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

0 commit comments

Comments
 (0)