sync.yml GitHub Actions workflow.
The HEAD_COMMIT file
HEAD_COMMIT is a plain text file at the repository root containing a single full commit SHA:
ref. This means:
- Builds are reproducible — the same SHA always produces the same docs.
- The deploy and CI workflows never silently pick up an unreviewed upstream change.
- The history of
HEAD_COMMITin git provides an audit trail of every webpack version that was documented.
The sync workflow
Thesync.yml workflow runs on a daily schedule and can also be triggered manually.
Schedule
The
workflow_dispatch trigger lets you run the sync at any time from the GitHub Actions UI without waiting for the next scheduled run. This is useful after making changes to the generation pipeline that you want to verify against the latest webpack commit immediately.Sync process
Fetch the latest webpack commit
The workflow queries the webpack/webpack repository for the current HEAD of the Both values are written to
main branch using git ls-remote, then reads the SHA currently stored in HEAD_COMMIT:$GITHUB_OUTPUT for use in later steps.Check for changes
The two SHAs are compared. If they match, the workflow sets
changed=false and all subsequent steps are skipped — no unnecessary work is done.Check out the new webpack commit
When
changed=true, the workflow checks out the webpack/webpack repository at the new SHA into the webpack/ subdirectory.Install dependencies and update HEAD_COMMIT
npm ci installs all dependencies. The new SHA is then written to HEAD_COMMIT, overwriting the previous value:Regenerate documentation
npm run generate-docs runs generate-md.mjs, which reads the freshly checked-out webpack/types.d.ts and writes updated Markdown into pages/v5.x/.When no changes are found
If the SHA inHEAD_COMMIT already matches the latest commit on webpack’s main branch, every step after the comparison check has an if: steps.check.outputs.changed == 'true' condition and is skipped entirely. The workflow exits successfully without modifying any files or creating a commit.