Skip to content

Commit 98e3c07

Browse files
authored
fix: clone CLI chart to /tmp to avoid submodule and copy helm docs correctly (#62)
Fixes two issues with the helm docs generation step: - Using `actions/checkout` with `path: cli-repo` placed a nested git repo inside the docs workspace, causing `create-pull-request` to stage it as a submodule. Replaced with a plain `git clone` to `/tmp/cli-repo` which is outside the tracked workspace. - `helm-docs --output-file` is relative to the chart directory and cannot write outside it. Instead, generate to the default `README.md` in the chart dir and copy it to `helm/k8s_reporter.md` in the docs repo.
1 parent 8153171 commit 98e3c07

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

.github/workflows/update-cli-docs.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ jobs:
5757
- name: Update CLI navigation in docs.json
5858
run: python scripts/update-cli-nav.py --docs-dir client_reference/ --config docs.json
5959

60-
- name: Checkout CLI repo at tag (sparse)
61-
uses: actions/checkout@v4
62-
with:
63-
repository: kosli-dev/cli
64-
ref: refs/tags/${{ steps.tag.outputs.cli_tag }}
65-
sparse-checkout: charts/k8s-reporter
66-
path: cli-repo
67-
6860
- name: Install helm-docs
6961
run: |
7062
curl -sL https://github.com/norwoodj/helm-docs/releases/download/v1.14.2/helm-docs_1.14.2_Linux_x86_64.deb --output helm-docs.deb
@@ -73,8 +65,13 @@ jobs:
7365
7466
- name: Generate helm docs
7567
run: |
76-
cd $GITHUB_WORKSPACE/cli-repo/charts/k8s-reporter
77-
helm-docs --template-files README.md.gotmpl,_templates.gotmpl --output-file $GITHUB_WORKSPACE/helm/k8s_reporter.md
68+
git clone --sparse --filter=blob:none --depth=1 \
69+
--branch ${{ steps.tag.outputs.cli_tag }} \
70+
https://github.com/kosli-dev/cli.git /tmp/cli-repo
71+
cd /tmp/cli-repo && git sparse-checkout set charts/k8s-reporter
72+
cd /tmp/cli-repo/charts/k8s-reporter
73+
helm-docs --template-files README.md.gotmpl,_templates.gotmpl
74+
cp /tmp/cli-repo/charts/k8s-reporter/README.md $GITHUB_WORKSPACE/helm/k8s_reporter.md
7875
7976
- name: Create Pull Request
8077
uses: peter-evans/create-pull-request@v8

0 commit comments

Comments
 (0)