Skip to content

Commit 3e06889

Browse files
committed
Test committing built files to themes.
1 parent ec0fcf5 commit 3e06889

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ on:
2626
- 'composer.*'
2727
# Confirm any changes to relevant workflow files.
2828
- '.github/workflows/check-built-files.yml'
29+
# Changes to the default themes should be handled by the themes workflows.
30+
- '!src/wp-content/themes/twenty**'
2931

3032
# Cancels all previous workflow runs for pull requests that have not completed.
3133
concurrency:

.github/workflows/commit-built-file-changes.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: Commit Built File Changes (PRs)
33

44
on:
55
workflow_run:
6-
workflows: [ 'Check Built Files (PRs)' ]
6+
workflows:
7+
- 'Check Built Files (PRs)'
8+
- 'Test Default Themes & Create ZIPs'
79
types:
810
- completed
911

@@ -35,7 +37,7 @@ jobs:
3537
update-built-files:
3638
name: Check and update built files
3739
runs-on: ubuntu-24.04
38-
if: ${{ github.repository == 'wordpress/wordpress-develop' }}
40+
if: ${{ github.repository == 'desrosj/wordpress-develop' }}
3941
timeout-minutes: 10
4042
permissions:
4143
contents: write

.github/workflows/test-and-zip-default-themes.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,32 @@ jobs:
148148
- name: Build theme
149149
run: npm run build
150150

151+
- name: Check for changes to versioned files
152+
id: built-file-check
153+
if: ${{ github.event_name == 'pull_request' }}
154+
run: |
155+
if git diff --quiet; then
156+
echo "uncommitted_changes=false" >> "$GITHUB_OUTPUT"
157+
else
158+
echo "uncommitted_changes=true" >> "$GITHUB_OUTPUT"
159+
fi
160+
161+
- name: Display changes to versioned files
162+
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
163+
run: git diff
164+
165+
- name: Save diff to a file
166+
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
167+
run: git diff > ./changes.diff
168+
169+
# Uploads the diff file as an artifact.
170+
- name: Upload diff file as artifact
171+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
172+
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
173+
with:
174+
name: pr-built-file-changes
175+
path: changes.diff
176+
151177
- name: Ensure version-controlled files are not modified or deleted
152178
run: git diff --exit-code
153179

0 commit comments

Comments
 (0)