ci(docs): rebuild the site when the root changelog changes - #287
Merged
Conversation
The docs site renders CHANGELOG.md through the docs/site/docs/changelog.md symlink, but the symlink's blob is a constant link target. Regenerating the changelog therefore changed no path under docs/site/**, the path filter never matched, and the published changelog silently fell a release behind (the site topped out at 0.2.0 while the repo was on 0.3.0). List the root CHANGELOG.md in both path filters. The release job's changelog commit is pushed with GITHUB_TOKEN, which by design raises no push event, so add workflow_dispatch and have that job trigger the docs workflow explicitly. Deploy now runs for any non-pull-request event, still gated on main so a dispatch from a branch cannot publish that branch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTLGuNs2qydUpLQ5vN8Jv5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Make the documentation site rebuild when the root
CHANGELOG.mdchanges. Two compounding bugs kept the published changelog stale.Why: The live site tops out at
[0.2.0] - 2026-07-22while the repo is on[0.3.0] - 2026-08-31. It is also missing the release-notes repair from #285.The first bug is the path filter.
docs/site/docs/changelog.mdis a symlink to the rootCHANGELOG.md, and MkDocs resolves it correctly at build time, so the wiring looks fine. But a symlink's git blob is just its constant target path (../../../CHANGELOG.md), which never changes. Regenerating the changelog therefore touches no path underdocs/site/**,docs.ymlnever fires, and the site only refreshed by accident whenever an unrelated commit happened to touchdocs/site/. That is exactly what happened last: the most recent deploy came from the v0.3.0 release-prep commit, and the two commits that actually updated the changelog afterwards changed zero files underdocs/site/.Adding
CHANGELOG.mdto the filter is necessary but not sufficient. Theupdate-changelogjob inrelease.ymlpushes its commit withGITHUB_TOKEN, and GitHub deliberately suppresses workflow runs triggered by that token, so the release-time changelog commit would still never rebuild the site.workflow_dispatchis one of only two eventsGITHUB_TOKENmay still trigger, so that job now dispatches the docs workflow explicitly. No PAT required.How to test
Merging this PR is itself the test. The commit touches
.github/workflows/docs.yml, which is in the push path filter, so it self-triggers a build and deploy. After the run completes, https://santosr2.github.io/TerraTidy/changelog/ should show a0.3.0section instead of topping out at0.2.0.Locally:
The release-time dispatch path can only be exercised by an actual tag push, so it is verified by inspection here.
Notes for reviewers
The deploy gate widened, and it is worth a look. It moved from
github.event_name == 'push' && github.ref == 'refs/heads/main'togithub.event_name != 'pull_request' && github.ref == 'refs/heads/main', because aworkflow_dispatchrun would otherwise build without deploying. The practical effect is that anyone who can dispatch the workflow can now trigger a Pages deploy. That was already true of anyone who could push to main, and therefs/heads/maincondition still blocks publishing an arbitrary branch, so I read this as no meaningful change in exposure. Happy to tighten it if you disagree.update-changeloggainsactions: write, whichgh workflow runrequires.Unrelated and untouched:
vscode/CHANGELOG.mdandvscode/LICENSEare also symlinks, andvscode.ymlhas the same path-filter blind spot. It is harmless there. That workflow is CI-only, and the marketplace publish job inrelease.ymlalready regenerates the changelog at package time precisely because a tag's tree freezes it at the pre-release state. Confirmed:git show v0.3.0:CHANGELOG.mdtops out at[0.2.0].No tests accompany this change; it is a CI trigger fix with no unit-testable surface.
mise run checkwas not run in full since no Go code changed, but the complete pre-commit suite passes, includingactionlint,zizmor, andyamllint.Checklist
mise run checkn/a, no Go changes)🤖 Generated with Claude Code