Skip to content

Commit aef3b34

Browse files
committed
Cleanup and improvement.
1 parent d51ac33 commit aef3b34

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

.github/workflows/pull-requests-built-files.yml renamed to .github/workflows/check-built-files.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
# Responsible for checking pull requests for changes to built files.
2-
name: Manage Built Files for PRs
1+
# Checks for uncommitted changes to built files and pushes changes back.
2+
name: Check built files
33

44
on:
5+
# Because all commits happen through SVN and should always be manually reviewed by a committer, this workflow only
6+
# runs for pull requests.
7+
#
8+
# Other workflows that run on push will detect changes to versioned files and fail.
59
pull_request_target:
610
branches:
711
- trunk
@@ -21,7 +25,7 @@ on:
2125
# These files configure Composer. Changes could affect the outcome.
2226
- 'composer.*'
2327
# Confirm any changes to relevant workflow files.
24-
- '.github/workflows/pull-requests-built-files.yml'
28+
- '.github/workflows/check-built-files.yml'
2529

2630
# Cancels all previous workflow runs for pull requests that have not completed.
2731
concurrency:
@@ -35,12 +39,34 @@ permissions: {}
3539

3640
jobs:
3741
# Checks a PR for uncommitted changes to built files.
42+
#
43+
# This job uses a GitHub App instead of $GITHUB_TOKEN because Dependabot pull requests are only granted
44+
# read-only access.
45+
#
46+
# Performs the following steps:
47+
# - Generates a token for authenticating with the GitHub App.
48+
# - Checks out the repository.
49+
# - Sets up Node.js.
50+
# - Configures caching for Composer.
51+
# - Installs Composer dependencies.
52+
# - Logs general debug information about the runner.
53+
# - Installs npm dependencies.
54+
# - Builds CSS file using SASS.
55+
# - Builds Emoji files.
56+
# - Builds bundled Root Certificate files.
57+
# - Builds WordPress.
58+
# - Configures the Git author.
59+
# - Checks for changes to versioned files.
60+
# - Stages changes.
61+
# - Commits changes.
62+
# - Pushes changes.
3863
update-built-files:
39-
name: Updates built files when necessary
64+
name: Check and update built files
4065
runs-on: ubuntu-24.04
4166
permissions:
4267
contents: write
43-
if: ${{ github.event_name == 'pull_request_target' && github.event.commits < 2 && 'dependabot[bot]' == github.actor }}
68+
# This prevents a second run after changes are committed back because Dependabot always rebases updates onto trunk.
69+
if: ${{ github.actor != 'dependabot[bot]' || github.event.commits < 2 }}
4470
steps:
4571
- name: Generate Installation Token
4672
id: generate_token
@@ -134,7 +160,7 @@ jobs:
134160
git config user.name "dependabot[bot]"
135161
git config user.email 49699333+dependabot[bot]@users.noreply.github.com
136162
137-
- name: Ensure version-controlled files are not modified or deleted during building
163+
- name: Check for changes to versioned files
138164
id: built-file-check
139165
run: |
140166
diff_output=$(git diff)

0 commit comments

Comments
 (0)