Skip to content

ci: stamp the package version into the Pages site at deploy - #29

Merged
Schero94 merged 1 commit into
mainfrom
ci/pages-version-stamp
Nov 19, 2026
Merged

Schero94 merged 1 commit into
mainfrom
ci/pages-version-stamp

Conversation

@Schero94

Copy link
Copy Markdown
Owner

What changes

The Pages site now shows the published version without the source ever hardcoding it.

  • docs/site/index.html (JSON-LD softwareVersion) and docs/site/llms.txt carry the token __PACKAGE_VERSION__.
  • pages.yml gets a step that replaces the token with the package.json version before the upload. The step fails if any token is left.
  • pages.yml also runs on workflow_run after the "Publish Package" workflow on main completes. semantic-release commits the new version with the workflow token, and that commit starts no push workflow, so without this the site would show the previous version.
  • The deploy job runs on a workflow_run only if the release run succeeded and was triggered by a push to main.

Security

  • The workflow checks out the default branch, never pull request code.
  • Permissions are unchanged: contents read, pages write, id-token write.
  • No new actions were added, and the existing ones keep their pins.

Checks

  • actionlint 1.7.12 on pages.yml: no findings.
  • Local run of the stamp: the JSON-LD parses with softwareVersion equal to package.json, and no token is left in llms.txt.
  • The repo's npm test, eslint and prettier --check . pass.

Commit type ci:, so no release.

🤖 Generated with Claude Code

The docs site source names no version. pages.yml now replaces the token
__PACKAGE_VERSION__ in docs/site (JSON-LD softwareVersion and llms.txt)
with the version from package.json and fails if a token is left.

semantic-release commits the new version with the workflow token, which
starts no push workflow, so Pages also redeploys on workflow_run after a
successful "Publish Package" run that a push to main triggered. The job checks out
the default branch (no pull request code), keeps contents: read plus
pages: write and id-token: write, and actions stay as they were.

Checked with actionlint 1.7.12. Docs read 2026-11-20: GitHub "Events that
trigger workflows" (workflow_run runs the default-branch workflow with
GITHUB_SHA at the last default-branch commit; branches filter; check
github.event.workflow_run.conclusion).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Schero94
Schero94 merged commit fedecfd into main Nov 19, 2026
8 checks passed
@Schero94
Schero94 deleted the ci/pages-version-stamp branch November 19, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant