Skip to content

ci: single-source the Hugo version (.hugoversion) + auto-bump (closes #15)#22

Merged
VijitSingh97 merged 1 commit into
mainfrom
claude/hugo-version-single-source
Jun 18, 2026
Merged

ci: single-source the Hugo version (.hugoversion) + auto-bump (closes #15)#22
VijitSingh97 merged 1 commit into
mainfrom
claude/hugo-version-single-source

Conversation

@VijitSingh97

Copy link
Copy Markdown
Contributor

Resolves #15. HUGO_VERSION was hardcoded independently in ci.yml (0.162.1) and deploy.yml (0.162.1) — they could silently drift, so CI could validate with a different Hugo than production deploys.

What this does

  • .hugoversion — one file, just the version string. The single source of truth.
  • ci.yml + deploy.yml read it in-step (HUGO_VERSION="$(cat .hugoversion)") instead of a literal env, so drift is impossible by construction. deploy.yml's build job is reordered to checkout before installing Hugo (the file has to exist first). Reading locally in the run block — not via $GITHUB_ENV — keeps it clear of the github-env injection class (zizmor stays clean).
  • hugo-bump.yml — a weekly scheduled job (+ workflow_dispatch) that checks gohugoio/hugo for a newer release and opens a PR editing .hugoversion (Dependabot can't track a wget'd .deb). Manual bump = just edit the file.
  • README documents .hugoversion as the single source.

Acceptance (#15)

  • Hugo version defined in exactly one place; both workflows read it
  • Drift impossible by construction (no second literal to forget)
  • Documented path (auto-PR and manual) keeps Hugo current

Verified

  • prettier/markdownlint clean, all workflow YAML valid, cat .hugoversion0.162.1
  • zizmor .github/workflows/ → no findings (incl. the new bump workflow)
  • The strict-build job in this PR exercises the new file-read path end-to-end.

Note: the bump PR is opened with the built-in GITHUB_TOKEN, which doesn't auto-trigger CI on the PR it creates — re-run CI on a bump PR before merging. Documented in the workflow header.

🤖 Generated with Claude Code

#15)

HUGO_VERSION was hardcoded independently in ci.yml and deploy.yml, so the two
could silently drift — CI validating with a different Hugo than production
deploys.

- .hugoversion: the single source of truth (just the version string).
- ci.yml + deploy.yml: read it in-step (`HUGO_VERSION="$(cat .hugoversion)"`)
  instead of a literal env, so drift is impossible by construction. deploy.yml's
  build job is reordered to checkout before installing Hugo (the file must exist
  first). Reading locally in the run block (not via $GITHUB_ENV) keeps it clear
  of the github-env injection class.
- hugo-bump.yml: weekly scheduled job (+ workflow_dispatch) that checks for a
  newer Hugo release and opens a PR editing .hugoversion (Dependabot can't track
  a wget'd .deb). Manual bump is just editing the file.
- README: document .hugoversion as the single source.

Verified locally: prettier/markdownlint clean, zizmor clean (incl. the new
workflow), version read resolves to 0.162.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VijitSingh97 VijitSingh97 merged commit 0fb2003 into main Jun 18, 2026
6 checks passed
@VijitSingh97 VijitSingh97 deleted the claude/hugo-version-single-source branch June 18, 2026 07:41
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.

tooling: single-source the Hugo version + add a bump mechanism

1 participant