Skip to content

ci(docs): one-click Docs Version Bump workflow - #22066

Merged
bloxster merged 6 commits into
mainfrom
ci/docs-version-bump-workflow-main
Jul 21, 2026
Merged

ci(docs): one-click Docs Version Bump workflow#22066
bloxster merged 6 commits into
mainfrom
ci/docs-version-bump-workflow-main

Conversation

@bloxster

Copy link
Copy Markdown
Collaborator

Adds .github/workflows/docs-version-bump.ymlworkflow_dispatch tooling to automate docs versioning when a new major/minor releases.

On main (replaces #22065, which targeted release/3.5): since release branches are cut from main, putting it here means every future release branch inherits it automatically.

What it does

Given archive_version (e.g. v3.5) and new_label (e.g. v3.6): snapshots the current docs as the archived version (docusaurus docs:version), bumps the current label, enforces the 3-archived-version cap, regenerates llms.txt, verifies npm run build, and opens a PR.

How to use

Run it on the new release branch right after it's cut (where docs/site/docs still holds the about-to-be-archived content).

Notes

  • Best paired with the versions.json-driven version injection (docs(site): publish v3.5 as default, archive v3.4 #22062) so no docusaurus.config.ts edits are needed per release. That infra currently lives on release/3.5; forward-porting it to main is recommended so release branches inherit it.
  • Does not move the Pages deploy trigger (still per-release-branch via docs-deploy.yml).
  • Requires the repo setting "Allow GitHub Actions to create and approve pull requests."

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a manually triggered GitHub Actions workflow to automate Docusaurus docs versioning for a new major/minor release (snapshot current docs into a versioned archive, bump the “current” label, prune old archives, regenerate llms.txt, build, and open a PR).

Changes:

  • Introduces .github/workflows/docs-version-bump.yml (workflow_dispatch) with archive_version and new_label inputs.
  • Automates docusaurus docs:version, current label bump, 3-version pruning, generate-llms.py, npm run build, and PR creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/docs-version-bump.yml Outdated
Comment thread .github/workflows/docs-version-bump.yml Outdated
Comment thread .github/workflows/docs-version-bump.yml Outdated
Comment thread .github/workflows/docs-version-bump.yml Outdated
Comment thread .github/workflows/docs-version-bump.yml Outdated
pull Bot pushed a commit to Dustin4444/erigon that referenced this pull request Jun 29, 2026
…igontech#22067)

Forward-ports the generic version-injection refactor (introduced on
`release/3.5` in erigontech#22062) to **`main`**, so every release branch cut from
main inherits it.

## Why on main
Release branches are cut from `main`. If this infra only lived on
`release/3.5`, `release/3.6` would revert to the old hardcoded
per-series resolver. Pairs with the Docs Version Bump workflow (erigontech#22066),
which also lives on main.

## What changes
- Replaces the hardcoded `fetchLatestV33Version` / `v33Version` with a
parametrized `fetchLatestSeriesVersion(prefix)` looped over
`versions.json`, building a `{id -> latest patch}` map.
- The remark plugin routes by the `version-vX.Y` path segment instead of
a hardcoded `version-v3.3` check.
- **Net effect:** adding an archived version (via `docusaurus
docs:version`) needs zero edits to `docusaurus.config.ts` or
`version-replace.js`.

## No behavior change here
`versions.json` is still `["v3.3"]` and the current label is still
`v3.4` — verified the build injects `3.3.1` into the v3.3 archive and
the latest release into current, exactly as before. This PR is purely
the mechanism.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Bloxster <gianni.morselli@erigon.tech>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lystopad

Copy link
Copy Markdown
Member

@bloxster ,hi

please, resolve:

artipacked
Check warning: artipacked
docs-version-bump.yml:42: credential persistence through GitHub Actions artifacts: does not set persist-credentials: false

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/docs-version-bump.yml
Comment thread .github/workflows/docs-version-bump.yml Outdated
Bloxster and others added 4 commits July 21, 2026 13:04
workflow_dispatch tooling to automate docs versioning on a new major/minor
release. Given an archive_version (freeze current docs) and new_label, it:
snapshots docs/site/docs into versioned_docs/version-<id>, bumps the current
version label, enforces the 3-archived-version cap, regenerates llms.txt,
verifies the build, and opens a PR.

Lives on main so every release branch (cut from main) inherits it; run it on
the new release branch right after it is cut. Does not move the Pages deploy
trigger.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Bump actions to match the repo's docs workflows: checkout v4->v7,
  setup-node v4->v6, setup-python v5->v6
- Validate inputs: require archive_version != new_label, and guard that
  docs/site exists (clear error on branches predating the Docusaurus site)
- Soften the header comment: the "no config edits" claim now correctly
  depends on the versions.json-driven generic injection being present

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Route workflow_dispatch inputs and github.ref_name through step-level
env: vars and reference them as "$VAR" in run: blocks, instead of
inlining ${{ inputs.* }} / ${{ github.ref_name }} directly into the
shell. Clears the 8 high-severity template-injection findings that were
failing `lint / lint` (zizmor) and, transitively, ci-gate.

Verified locally: `zizmor --config .github/zizmor.yml` exits 12 (< 14
gate threshold); only the pre-existing low-severity artipacked warning
remains, which cannot be resolved here since the job needs persisted
credentials for its git push.
…topad)

- artipacked (Lystopad): set persist-credentials: false on checkout and
  authenticate the PR-opening push explicitly via GH_TOKEN, so the checkout
  token is no longer persisted in .git/config.
- Soften the header comment: version-replace.js currently special-cases
  archived versions by path (e.g. version-v3.3) rather than resolving
  generically from versions.json, so a new archived version with
  {ERIGON_VERSION} placeholders may still need a manual plugin/config case.
- Validate inputs: reject a new_label that collides with an existing
  archived version in versions.json (mirrors the archive_version check).
- Open PR step: suffix the auto branch name with the run id so re-runs or a
  partially-failed prior run don't collide with an existing remote branch.

zizmor (repo config) now reports zero findings on this workflow.
@bloxster
bloxster force-pushed the ci/docs-version-bump-workflow-main branch from d104943 to 01c7b2b Compare July 21, 2026 11:05
@bloxster

Copy link
Copy Markdown
Collaborator Author

@lystopad — thanks, fixed the artipacked finding in 01c7b2b: the checkout now sets persist-credentials: false and the PR-opening step authenticates its push explicitly via GH_TOKEN (no token persisted in .git/config). zizmor --config .github/zizmor.yml now reports 0 findings on this workflow.

Also addressed the Copilot review (softened the header re version-replace.js, added a new_label collision check, made the auto branch name retry-safe) and rebased onto latest main.

@yperbasis @AskAlexSharov — ready for another look when you have a moment 🙏

@lystopad

Copy link
Copy Markdown
Member

@bloxster , please add "run-name:" with input parameters as values, which will help to find exact workflow run across multiple past runs.

Sets a top-level run-name interpolating archive_version/new_label so each
manual dispatch is distinguishable in the Actions run list (per review
from @lystopad). run-name is a display string (not a shell context), so
interpolating inputs directly is safe — zizmor reports 0 findings.
@bloxster

Copy link
Copy Markdown
Collaborator Author

@lystopad — added in dd0721c:

run-name: "Docs Version Bump — archive ${{ inputs.archive_version }}, publish ${{ inputs.new_label }}"

so each manual dispatch is identifiable in the Actions run list by the versions it archives/publishes. zizmor still reports 0 findings. Thanks for the review 🙏

@bloxster
bloxster added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit a266d65 Jul 21, 2026
94 checks passed
@bloxster
bloxster deleted the ci/docs-version-bump-workflow-main branch July 21, 2026 13:15
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.

3 participants