ci(docs): one-click Docs Version Bump workflow - #22066
Conversation
There was a problem hiding this comment.
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) witharchive_versionandnew_labelinputs. - 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.
…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>
|
@bloxster ,hi please, resolve: |
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.
d104943 to
01c7b2b
Compare
|
@lystopad — thanks, fixed the Also addressed the Copilot review (softened the header re @yperbasis @AskAlexSharov — ready for another look when you have a moment 🙏 |
|
@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.
Adds
.github/workflows/docs-version-bump.yml—workflow_dispatchtooling to automate docs versioning when a new major/minor releases.On
main(replaces #22065, which targetedrelease/3.5): since release branches are cut frommain, putting it here means every future release branch inherits it automatically.What it does
Given
archive_version(e.g.v3.5) andnew_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, regeneratesllms.txt, verifiesnpm run build, and opens a PR.How to use
Run it on the new release branch right after it's cut (where
docs/site/docsstill holds the about-to-be-archived content).Notes
versions.json-driven version injection (docs(site): publish v3.5 as default, archive v3.4 #22062) so nodocusaurus.config.tsedits are needed per release. That infra currently lives onrelease/3.5; forward-porting it tomainis recommended so release branches inherit it.docs-deploy.yml).🤖 Generated with Claude Code