|
24 | 24 | # - Builds Emoji files. |
25 | 25 | # - Builds bundled Root Certificate files. |
26 | 26 | # - Builds WordPress. |
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. |
| 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. |
31 | 30 | # - Uploads the patch file as an artifact. |
32 | 31 | update-built-files: |
33 | 32 | name: Check and update built files |
@@ -79,26 +78,22 @@ jobs: |
79 | 78 | - name: Build WordPress |
80 | 79 | run: npm run build:dev |
81 | 80 |
|
82 | | - - name: Check for uncommitted changes |
| 81 | + - name: Check for changes to versioned files |
83 | 82 | id: built-file-check |
84 | 83 | run: | |
85 | | - if [ -z "$(git status --porcelain)" ]; then |
| 84 | + if git diff --quiet; then |
86 | 85 | echo "uncommitted_changes=false" >> "$GITHUB_OUTPUT" |
87 | 86 | else |
88 | 87 | echo "uncommitted_changes=true" >> "$GITHUB_OUTPUT" |
89 | 88 | fi |
90 | 89 |
|
91 | | - - name: Stage all changes for diff generation |
| 90 | + - name: Display changes to versioned files |
92 | 91 | if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }} |
93 | | - run: git add -A |
94 | | - |
95 | | - - name: Display all uncommitted changes |
96 | | - if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }} |
97 | | - run: git diff --cached |
| 92 | + run: git diff |
98 | 93 |
|
99 | 94 | - name: Save diff to a file |
100 | 95 | if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }} |
101 | | - run: git diff --cached --binary > ./changes.diff |
| 96 | + run: git diff > ./changes.diff |
102 | 97 |
|
103 | 98 | # Uploads the diff file as an artifact. |
104 | 99 | - name: Upload diff file as artifact |
|
0 commit comments