Skip to content

ci(platform): auto-regenerate helm-docs README on release-please PRs - #201

Open
jp-ayyappan wants to merge 2 commits into
mainfrom
ci-helm-docs-release-sync-4b8f2a9c1d
Open

ci(platform): auto-regenerate helm-docs README on release-please PRs#201
jp-ayyappan wants to merge 2 commits into
mainfrom
ci-helm-docs-release-sync-4b8f2a9c1d

Conversation

@jp-ayyappan

@jp-ayyappan jp-ayyappan commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Durable fix for the recurring Helm Lint failure on release-please PRs (follow-up to the manual README regen on #200).

Root cause: release-please bumps the chart version in Chart.yaml but does not run helm-docs. The README version badge is rendered by helm-docs from Chart.yaml, so on every release PR the badge goes stale (e.g. 0.15.0 while Chart.yaml says 0.16.0). The Helm Lint job runs helm-docs and then fails on the "Fail if docs are not up-to-date" step because the committed README differs from the regenerated one. This is exactly why PR #200 (platform 0.16.0) failed lint.

Fix: Add a Release Docs Sync workflow that:

  • triggers on PRs to main whose head branch starts with release-please--,
  • runs helm-docs (same pinned 1.13.1 version + SHA and --chart-search-root=charts as lint.yaml, so output is byte-identical to what the lint gate expects),
  • commits the regenerated charts/*/README.md back to the release branch only if it changed.

The push uses the existing GitHub App token (APP_ID / AUTOMATION_KEY, same app release-please uses), so the follow-up commit re-triggers the required checks and the lint gate goes green on its own. If the README is already current, the job is a no-op, so it self-heals when release-please force-updates its branch on the next release.

Why a workflow and not release-please extra-files

The README badge is owned/generated by helm-docs. A release-please extra-files annotation comment placed in README.md would be stripped the next time helm-docs runs (in the lint gate), reintroducing a diff. Regenerating with helm-docs on the release branch keeps a single source of truth and matches how the repo already produces docs (lint + pre-commit).

Notes

  • Scoped to release-please branches via the job-level if, so it never runs on normal contributor PRs.
  • The committed sign-off uses the github-actions[bot] identity to satisfy the DCO check.

Test plan

  • On the next platform release PR, confirm Release Docs Sync runs, pushes a README regen commit, and the lint check goes green without manual edits.
  • Confirm the workflow is a no-op (no commit) when the README is already up to date.

Summary by CodeRabbit

  • Documentation
    • Added automated documentation updates for release pull requests.
    • Chart documentation is regenerated and committed when changes are detected.

release-please bumps chart versions in Chart.yaml but does not run
helm-docs, so the README version badge goes stale on every release PR
and the "Helm Lint -> Fail if docs are not up-to-date" gate fails
(e.g. PR #200 for platform 0.16.0).

Add a Release Docs Sync workflow that regenerates the helm-docs README
on release-please PR branches and commits the result back, so the lint
gate stays green without hand-editing the auto-generated release PR.

Signed-off-by: Jp Ayyappan <108297634+jp-ayyappan@users.noreply.github.com>

Co-authored-by: CoopAgent <coopagent@users.noreply.github.com>
@jp-ayyappan
jp-ayyappan requested a review from a team as a code owner August 3, 2026 18:32
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jp-ayyappan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 465e8239-7717-4286-b2b7-325bce08fcf5

📥 Commits

Reviewing files that changed from the base of the PR and between 31a44b2 and 9a78bc3.

📒 Files selected for processing (1)
  • .github/workflows/release-docs.yaml
📝 Walkthrough

Walkthrough

The pull request adds a GitHub Actions workflow that detects release-please pull requests, generates a scoped token, checks out the release branch, runs verified helm-docs, and pushes changed chart READMEs.

Changes

Release documentation synchronization

Layer / File(s) Summary
Workflow trigger and scope
.github/workflows/release-docs.yaml
The workflow runs for selected pull request events targeting main and limits execution to release-please branches.
Token generation and branch checkout
.github/workflows/release-docs.yaml
The workflow creates a scoped GitHub App token and checks out the release branch with full history.
Documentation generation and push
.github/workflows/release-docs.yaml
The workflow verifies helm-docs v1.13.1, regenerates chart READMEs, and pushes changes when documentation differs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant GitHubActions
  participant GitHubApp
  participant HelmDocs
  participant ReleaseBranch
  PullRequest->>GitHubActions: Trigger release documentation workflow
  GitHubActions->>GitHubApp: Generate scoped token
  GitHubActions->>ReleaseBranch: Checkout release branch
  GitHubActions->>HelmDocs: Verify and run helm-docs
  HelmDocs->>ReleaseBranch: Update chart READMEs
  GitHubActions->>ReleaseBranch: Commit and push changes
Loading

Possibly related PRs

  • opentdf/charts#196: Both pull requests automate helm-docs workflows for Helm chart documentation.

Suggested reviewers: eastokes

Poem

A rabbit checks the charts at night,
Runs helm-docs clean and bright.
If README pages change their tune,
The bot commits beneath the moon.
Release branches hop along.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the workflow that regenerates helm-docs README files for release-please pull requests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci-helm-docs-release-sync-4b8f2a9c1d

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release-docs.yaml:
- Around line 60-70: Update the “Commit regenerated README(s)” step to pass
github.event.pull_request.head.ref through the step environment, then use the
quoted Bash environment variable in the git push command instead of embedding
the GitHub expression in the shell script. Preserve the existing checkout target
and commit flow.
- Around line 30-43: Update the Generate a token step using
actions/create-github-app-token to request only the contents write permission by
adding the appropriate permission-contents configuration. Keep the existing
app-id, private-key, and Checkout release branch token usage unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 34eb61e3-37f2-4c6a-879e-a195827bfde1

📥 Commits

Reviewing files that changed from the base of the PR and between 4fbf4d4 and 31a44b2.

📒 Files selected for processing (1)
  • .github/workflows/release-docs.yaml

Comment thread .github/workflows/release-docs.yaml
Comment thread .github/workflows/release-docs.yaml Outdated
Comment thread .github/workflows/release-docs.yaml Outdated
uses: actions/create-github-app-token@f2acddfb5195534d487896a656232b016a682f3c # v1.9.0
with:
app-id: "${{ secrets.APP_ID }}"
private-key: "${{ secrets.AUTOMATION_KEY }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

scope permissions to only what you need
permission-contents: write

Address CodeRabbit + reviewer feedback on #201:

- Fix template-injection (script injection) in the commit step: pass
  github.event.pull_request.head.ref through a HEAD_REF env var and use
  the quoted "${HEAD_REF}" in git push instead of inlining the GitHub
  expression in the shell script.
- Scope the generated app token with permission-contents: write so it
  only holds the contents:write permission this workflow needs.

Signed-off-by: olive <olive@virtru.com>

Co-authored-by: CoopAgent <coopagent@users.noreply.github.com>
@jp-ayyappan

Copy link
Copy Markdown
Contributor Author

Thanks for the review @kalynnrhew77 / @coderabbitai. Both points addressed in 9a78bc3:

  • Script injection (critical, line 70): Moved github.event.pull_request.head.ref into a step-level env: var (HEAD_REF) and reference the quoted "${HEAD_REF}" in git push, so the untrusted branch name is no longer expanded inline in the shell script. Clears the actionlint + zizmor template-injection findings.
  • Token scope (line 35): Added permission-contents: write to the create-github-app-token step so the generated token holds only the contents:write permission this workflow actually needs (push regenerated READMEs).

No functional change to the helm-docs regen/commit flow.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

workflow=".github/workflows/release-docs.yaml"

if [[ ! -f "$workflow" ]]; then
  echo "Workflow file not found: $workflow" >&2
  exit 1
fi

echo "== Current commit =="
git rev-parse HEAD

echo "== Workflow content =="
cat -n "$workflow"

echo "== Relevant security-sensitive references =="
rg -n -C 4 \
  'permission-contents|HEAD_REF|github\.event\.pull_request\.head\.ref|git push|create-github-app-token' \
  "$workflow"

Length of output: 6316


@jp-ayyappan Verified in 9a78bc3.

HEAD_REF is set through the step env: at Line 66. The git push command uses the quoted "HEAD:${HEAD_REF}" expansion at Line 76. This resolves the shell template-injection finding.

The GitHub App token step sets permission-contents: write at Line 37. This limits the generated token to the permission required to push the regenerated README files.

🐇 ✅


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

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.

2 participants