Skip to content

chore(ci): Automate documentation release pipeline#3492

Open
dishaprakash wants to merge 4 commits into
mainfrom
docs-pipeline-automate
Open

chore(ci): Automate documentation release pipeline#3492
dishaprakash wants to merge 4 commits into
mainfrom
docs-pipeline-automate

Conversation

@dishaprakash

@dishaprakash dishaprakash commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Automates the manual release pipeline of updating Hugo version dropdown configurations during the release process.

Background

Currently, when a new release is prepared (via a release-please PR), a maintainer has to manually edit .hugo/hugo.cloudflare.toml to add the new version block and prune the oldest version from the Cloudflare configuration. This PR introduces a automation pipeline to handle this seamlessly.

Changes

  1. Automation Script ([.ci/update_docs_versions.py]):
    • A lightweight, idempotent Python script that reads the new version (either passed as a command-line argument or read from cmd/version.txt).
    • Inserts the new version block in the TOML file right after the version list comment marker while fully preserving existing comments, spacing, and formatting.
    • For hugo.cloudflare.toml, it automatically prunes the oldest version, keeping the list capped at exactly 8 versions (dev + the 7 most recent releases).
  2. GitHub Actions Workflow ([.github/workflows/update_release_docs_config.yml]):
    • Supports a hybrid trigger:
      • Automated Mode: Automatically runs on PRs opened/updated by release-please and commits/pushes the version updates directly back into the release PR branch.
      • Manual Mode (workflow_dispatch): Allows maintainers to run the workflow manually on any branch (e.g. main or a release branch) with an optional version input.

@dishaprakash dishaprakash requested a review from a team as a code owner June 22, 2026 12:16

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a Python script .ci/update_docs_versions.py to automate updating documentation versions in the Hugo configuration file (hugo.cloudflare.toml). The script inserts new version blocks and prunes older ones to keep a maximum of eight versions. The review feedback recommends improving the robustness of the regular expressions used: first, by escaping the version string to prevent dots from being treated as wildcards, and second, by using a more flexible pattern to match the version blocks regardless of field order or formatting.

Comment thread .ci/update_docs_versions.py Outdated
Comment thread .ci/update_docs_versions.py Outdated
dishaprakash and others added 2 commits June 22, 2026 17:48
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

- name: Commit and Push Changes
run: |
git config user.name "github-actions[bot]"

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.

We can't use the Github action bot to commit changes since it can not sign the CLA (go/cla). @twishabansal has a solution to update the release please PR using that identity

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dishaprakash dishaprakash requested a review from averikitsch July 1, 2026 07:45
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