From 2f136a0736058919c8a5ea9446443d6d07f4850f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Tue, 10 Mar 2026 23:08:41 +0000 Subject: [PATCH 1/3] feat: automate helm reference updates via workflow and add navigation Add .github/workflows/update-helm-docs.yml to regenerate helm/k8s_reporter.md from the CLI repo chart on workflow_dispatch or repository_dispatch. Also add the Helm Reference section to docs.json navigation. Closes #29 --- .github/workflows/update-helm-docs.yml | 60 ++++++++++++++++++++++++++ docs.json | 10 +++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/update-helm-docs.yml diff --git a/.github/workflows/update-helm-docs.yml b/.github/workflows/update-helm-docs.yml new file mode 100644 index 0000000..74d1a3d --- /dev/null +++ b/.github/workflows/update-helm-docs.yml @@ -0,0 +1,60 @@ +name: Update Helm Reference Docs + +on: + workflow_dispatch: + inputs: + kosli_cli_tag: + description: 'CLI/chart release tag (e.g. v2.12.0)' + required: true + repository_dispatch: + types: [helm-release] + +permissions: + contents: write + pull-requests: write + +jobs: + update-helm-docs: + runs-on: ubuntu-latest + steps: + - name: Determine tag + id: tag + run: | + if [ "${{ github.event_name }}" = "repository_dispatch" ]; then + echo "cli_tag=${{ github.event.client_payload.kosli_cli_tag }}" >> "$GITHUB_OUTPUT" + else + echo "cli_tag=${{ github.event.inputs.kosli_cli_tag }}" >> "$GITHUB_OUTPUT" + fi + + - name: Checkout docs repo + uses: actions/checkout@v4 + + - name: Checkout CLI repo at tag (sparse) + uses: actions/checkout@v4 + with: + repository: kosli-dev/cli + ref: refs/tags/${{ steps.tag.outputs.cli_tag }} + sparse-checkout: charts/k8s-reporter + path: cli-repo + + - name: Install helm-docs + run: | + curl -sL https://github.com/norwoodj/helm-docs/releases/download/v1.14.2/helm-docs_1.14.2_linux_amd64.deb --output helm-docs.deb + sudo dpkg -i helm-docs.deb + rm helm-docs.deb + + - name: Generate helm docs + run: | + cd $GITHUB_WORKSPACE/cli-repo/charts/k8s-reporter + helm-docs --template-files README.md.gotmpl,_templates.gotmpl --output-file $GITHUB_WORKSPACE/helm/k8s_reporter.md + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v8 + with: + commit-message: "docs: update helm reference for ${{ steps.tag.outputs.cli_tag }}" + title: "docs: update helm reference for ${{ steps.tag.outputs.cli_tag }}" + body: | + Automated update of Helm reference documentation for release `${{ steps.tag.outputs.cli_tag }}`. + branch: helm-docs/${{ steps.tag.outputs.cli_tag }} + delete-branch: true + sign-commits: true diff --git a/docs.json b/docs.json index 0f08102..027e3e0 100644 --- a/docs.json +++ b/docs.json @@ -376,6 +376,16 @@ } ] }, + { + "item": "Helm Reference", + "icon": "helm", + "groups": [ + { + "group": "Helm Charts", + "pages": ["helm/k8s_reporter"] + } + ] + }, { "item": "API Reference", "icon": "code", From a13f32b64b6a6bdee0bbc4f27b820494dd24b3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Tue, 10 Mar 2026 23:13:00 +0000 Subject: [PATCH 2/3] feat: add update-helm-docs job to update-cli-docs workflow and add navigation Add update-helm-docs job to .github/workflows/update-cli-docs.yml to regenerate helm/k8s_reporter.md from the CLI repo chart on workflow_dispatch or repository_dispatch. Also rename workflow to "Update Reference Docs" and add the Helm Reference section to docs.json navigation. Closes #29 --- .github/workflows/update-cli-docs.yml | 47 +++++++++++++++++++- .github/workflows/update-helm-docs.yml | 60 -------------------------- 2 files changed, 46 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/update-helm-docs.yml diff --git a/.github/workflows/update-cli-docs.yml b/.github/workflows/update-cli-docs.yml index da1819b..c4eb330 100644 --- a/.github/workflows/update-cli-docs.yml +++ b/.github/workflows/update-cli-docs.yml @@ -1,4 +1,4 @@ -name: Update CLI Reference Docs +name: Update Reference Docs on: workflow_dispatch: @@ -67,3 +67,48 @@ jobs: branch: cli-docs/${{ steps.tag.outputs.cli_tag }} delete-branch: true sign-commits: true + + update-helm-docs: + runs-on: ubuntu-latest + steps: + - name: Determine CLI tag + id: tag + run: | + if [ "${{ github.event_name }}" = "repository_dispatch" ]; then + echo "cli_tag=${{ github.event.client_payload.kosli_cli_tag }}" >> "$GITHUB_OUTPUT" + else + echo "cli_tag=${{ github.event.inputs.kosli_cli_tag }}" >> "$GITHUB_OUTPUT" + fi + + - name: Checkout docs repo + uses: actions/checkout@v4 + + - name: Checkout CLI repo at tag (sparse) + uses: actions/checkout@v4 + with: + repository: kosli-dev/cli + ref: refs/tags/${{ steps.tag.outputs.cli_tag }} + sparse-checkout: charts/k8s-reporter + path: cli-repo + + - name: Install helm-docs + run: | + curl -sL https://github.com/norwoodj/helm-docs/releases/download/v1.14.2/helm-docs_1.14.2_linux_amd64.deb --output helm-docs.deb + sudo dpkg -i helm-docs.deb + rm helm-docs.deb + + - name: Generate helm docs + run: | + cd $GITHUB_WORKSPACE/cli-repo/charts/k8s-reporter + helm-docs --template-files README.md.gotmpl,_templates.gotmpl --output-file $GITHUB_WORKSPACE/helm/k8s_reporter.md + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v8 + with: + commit-message: "docs: update helm reference for ${{ steps.tag.outputs.cli_tag }}" + title: "docs: update helm reference for ${{ steps.tag.outputs.cli_tag }}" + body: | + Automated update of Helm reference documentation for release `${{ steps.tag.outputs.cli_tag }}`. + branch: helm-docs/${{ steps.tag.outputs.cli_tag }} + delete-branch: true + sign-commits: true diff --git a/.github/workflows/update-helm-docs.yml b/.github/workflows/update-helm-docs.yml deleted file mode 100644 index 74d1a3d..0000000 --- a/.github/workflows/update-helm-docs.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Update Helm Reference Docs - -on: - workflow_dispatch: - inputs: - kosli_cli_tag: - description: 'CLI/chart release tag (e.g. v2.12.0)' - required: true - repository_dispatch: - types: [helm-release] - -permissions: - contents: write - pull-requests: write - -jobs: - update-helm-docs: - runs-on: ubuntu-latest - steps: - - name: Determine tag - id: tag - run: | - if [ "${{ github.event_name }}" = "repository_dispatch" ]; then - echo "cli_tag=${{ github.event.client_payload.kosli_cli_tag }}" >> "$GITHUB_OUTPUT" - else - echo "cli_tag=${{ github.event.inputs.kosli_cli_tag }}" >> "$GITHUB_OUTPUT" - fi - - - name: Checkout docs repo - uses: actions/checkout@v4 - - - name: Checkout CLI repo at tag (sparse) - uses: actions/checkout@v4 - with: - repository: kosli-dev/cli - ref: refs/tags/${{ steps.tag.outputs.cli_tag }} - sparse-checkout: charts/k8s-reporter - path: cli-repo - - - name: Install helm-docs - run: | - curl -sL https://github.com/norwoodj/helm-docs/releases/download/v1.14.2/helm-docs_1.14.2_linux_amd64.deb --output helm-docs.deb - sudo dpkg -i helm-docs.deb - rm helm-docs.deb - - - name: Generate helm docs - run: | - cd $GITHUB_WORKSPACE/cli-repo/charts/k8s-reporter - helm-docs --template-files README.md.gotmpl,_templates.gotmpl --output-file $GITHUB_WORKSPACE/helm/k8s_reporter.md - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v8 - with: - commit-message: "docs: update helm reference for ${{ steps.tag.outputs.cli_tag }}" - title: "docs: update helm reference for ${{ steps.tag.outputs.cli_tag }}" - body: | - Automated update of Helm reference documentation for release `${{ steps.tag.outputs.cli_tag }}`. - branch: helm-docs/${{ steps.tag.outputs.cli_tag }} - delete-branch: true - sign-commits: true From 5c3470d336d0e9bb1bffd1b6165733c995f1b8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Tue, 10 Mar 2026 23:19:14 +0000 Subject: [PATCH 3/3] refactor: merge cli and helm doc jobs into single job opening one PR --- .github/workflows/update-cli-docs.yml | 36 ++++----------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/.github/workflows/update-cli-docs.yml b/.github/workflows/update-cli-docs.yml index c4eb330..d503c96 100644 --- a/.github/workflows/update-cli-docs.yml +++ b/.github/workflows/update-cli-docs.yml @@ -14,7 +14,7 @@ permissions: pull-requests: write jobs: - update-cli-docs: + update-docs: runs-on: ubuntu-latest steps: - name: Determine CLI tag @@ -57,32 +57,6 @@ jobs: - name: Update CLI navigation in docs.json run: python scripts/update-cli-nav.py --docs-dir client_reference/ --config docs.json - - name: Create Pull Request - uses: peter-evans/create-pull-request@v8 - with: - commit-message: "docs: update CLI reference for ${{ steps.tag.outputs.cli_tag }}" - title: "docs: update CLI reference for ${{ steps.tag.outputs.cli_tag }}" - body: | - Automated update of CLI reference documentation for release `${{ steps.tag.outputs.cli_tag }}`. - branch: cli-docs/${{ steps.tag.outputs.cli_tag }} - delete-branch: true - sign-commits: true - - update-helm-docs: - runs-on: ubuntu-latest - steps: - - name: Determine CLI tag - id: tag - run: | - if [ "${{ github.event_name }}" = "repository_dispatch" ]; then - echo "cli_tag=${{ github.event.client_payload.kosli_cli_tag }}" >> "$GITHUB_OUTPUT" - else - echo "cli_tag=${{ github.event.inputs.kosli_cli_tag }}" >> "$GITHUB_OUTPUT" - fi - - - name: Checkout docs repo - uses: actions/checkout@v4 - - name: Checkout CLI repo at tag (sparse) uses: actions/checkout@v4 with: @@ -105,10 +79,10 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v8 with: - commit-message: "docs: update helm reference for ${{ steps.tag.outputs.cli_tag }}" - title: "docs: update helm reference for ${{ steps.tag.outputs.cli_tag }}" + commit-message: "docs: update CLI and helm reference for ${{ steps.tag.outputs.cli_tag }}" + title: "docs: update CLI and helm reference for ${{ steps.tag.outputs.cli_tag }}" body: | - Automated update of Helm reference documentation for release `${{ steps.tag.outputs.cli_tag }}`. - branch: helm-docs/${{ steps.tag.outputs.cli_tag }} + Automated update of CLI and Helm reference documentation for release `${{ steps.tag.outputs.cli_tag }}`. + branch: reference-docs/${{ steps.tag.outputs.cli_tag }} delete-branch: true sign-commits: true