From 43a5204c2d197837195065c68f204f2ced4efb72 Mon Sep 17 00:00:00 2001 From: Marco Lecheler Date: Mon, 5 Oct 2026 23:47:21 +0200 Subject: [PATCH 1/2] feat: port chart-releaser release pipeline from helm-template Adapted for taskmedia/helm's multi-chart charts/ layout and the issue #2 research findings: keep the fty4 chart-releaser-action fork (upstream immutable-releases fix still unmerged), rely on the existing contents: write job permission (repo default is already write, no Settings change needed), and replace the main-branch README mirror step with one that edits gh-pages' own README.md in place and bootstraps the chart-table markers on first run, since main has no README.md to mirror from here. --- .github/workflows/release.yaml | 113 +++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..e22c973 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,113 @@ +name: Release Charts + +on: + push: + branches: + - main + paths: + - "charts/**" + +jobs: + release: + # repo-level default_workflow_permissions is "write" (confirmed via + # `gh api repos/taskmedia/helm/actions/permissions/workflow`), so this + # job-level grant is sufficient without any org/repo settings change. + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v4 + with: + version: v3.10.0 + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: Run chart-releaser + id: cr + # uses: helm/chart-releaser-action@v1.7.0 + # using patched action - see https://github.com/helm/chart-releaser/pull/587 + uses: fty4/helm_chart-releaser-action@v1.8.1-rc1 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + charts_dir: charts + mark_as_latest: false + skip_existing: true + + # Update the chart table in gh-pages' own README.md with the latest + # versions from index.yaml. Unlike helm-template, taskmedia/helm has no + # README.md on `main` to mirror from (gh-pages owns its README + # directly), so this edits the checked-out gh-pages README in place + # and bootstraps the start/end markers on first run if they're missing. + - name: Checkout gh-pages + if: steps.cr.outputs.changed_charts != '' + run: | + git fetch origin gh-pages:gh-pages + git checkout gh-pages + + - name: Generate chart table with yq + id: chart_table + if: steps.cr.outputs.changed_charts != '' + uses: mikefarah/yq@v4.54.1 + with: + cmd: >- + yq -r ' + "| Chart | Version | Description | Released |\n|------|---------|-------------|----------|", + ( + .entries + | to_entries[] + | .key as $chart + | .value[0] + | "| " + $chart + + " | [" + .version + + "](" + .urls[0] + + ") | " + .description + + " | " + (.created | split("T")[0]) + + " |" + ) + ' index.yaml + + - name: Update gh-pages README + if: steps.cr.outputs.changed_charts != '' + shell: bash + run: | + CHART_TABLE="${{ steps.chart_table.outputs.result }}" + if grep -q '' README.md; then + awk -v table="$CHART_TABLE" ' + // { print; print table; in_charts=1; next } + // { in_charts=0; print; next } + !in_charts { print } + ' README.md > README.md.tmp + mv README.md.tmp README.md + else + { + echo "" + echo "## Charts" + echo "" + echo "" + echo "$CHART_TABLE" + echo "" + } >> README.md + fi + + - name: Commit and push README update + if: steps.cr.outputs.changed_charts != '' + run: | + git add README.md + if ! git diff --cached --quiet; then + git commit -m "docs: update chart list in gh-pages README [skip ci]" + git push origin gh-pages + else + echo "No changes to commit." + fi From b0a660570e07e9cb4045b52f433f2b8cca68424f Mon Sep 17 00:00:00 2001 From: Marco Lecheler Date: Tue, 6 Oct 2026 00:02:04 +0200 Subject: [PATCH 2/2] fix: hardcode ct target-branch to main repo's default_branch is still gh-pages (pending the cutover in #1), and gh-pages has no charts/ directory, so `ct list-changed`/`ct lint` using --target-branch \${{ github.event.repository.default_branch }} fail outright instead of diffing against a real chart history. --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b1c5def..1fbcb27 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,7 +30,7 @@ jobs: - name: Run chart-testing (list-changed) id: list-changed run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + changed=$(ct list-changed --target-branch main) if [[ -n "$changed" ]]; then echo "changed=true" >> $GITHUB_OUTPUT fi @@ -40,7 +40,7 @@ jobs: run: | ct lint \ --check-version-increment=false \ - --target-branch ${{ github.event.repository.default_branch }} + --target-branch main - name: Create kind cluster uses: helm/kind-action@v1.13.0