Skip to content

update-helm-chart.yml

Trigger a chart update workflow in a remote Helm charts repository (caller mode) or update a chart in-place (called mode) by incrementing its version and regenerating documentation.

Inputs

InputTypeDescriptionRequiredDefault
RUN_MODEstringExecution mode: caller (trigger remote repo workflow) or called (update chart in current repo)Yes-
WORKFLOW_NAMEstringWorkflow file name in chart repo to trigger (caller mode)Noupdate-app-version.yml
CHART_REPOstringTarget chart repository (owner/repo) when in caller modeNo-
CHART_NAMEstringName of the chart directory under charts/Yes-
APP_VERSIONstringApplication version to set in Chart.yaml (appVersion)Yes-
UPGRADE_TYPEstringWhich SemVer part to increment: major, minor, patch, or prereleaseNopatch
PRERELEASE_IDENTIFIERstringIdentifier used when UPGRADE_TYPE=prerelease (e.g. rc)Norc

Secrets

SecretDescriptionRequiredDefault
GH_PATGitHub Personal Access Token (needed to trigger remote workflow / create PR)No-

Permissions

ScopeAccessDescription
pull-requestswriteCreate/update the chart update PR
contentswriteCommit modified chart & docs
actionswriteTrigger remote workflow (caller mode)

Notes

  • RUN_MODE=caller: Validates CHART_REPO is provided, then invokes gh workflow run <WORKFLOW_NAME> in the target repo, forwarding: CHART_NAME, APP_VERSION, UPGRADE_TYPE, PRERELEASE_IDENTIFIER, and forcing RUN_MODE=called in the remote execution.
  • RUN_MODE=called: Reads current chart version from charts/<CHART_NAME>/Chart.yaml (via yq), computes NEXT_VERSION using npx semver -i <UPGRADE_TYPE> (adding --preid <PRERELEASE_IDENTIFIER> when UPGRADE_TYPE=prerelease), updates both version and appVersion, regenerates docs with helm-docs, and creates/updates a PR containing the bump.
  • Branch naming pattern: <chart-name>-v<NEXT_VERSION>.
  • Tooling requirements: yq, node (for npx semver), and docker (for jnorwood/helm-docs). Use an image / setup step that provides them.
  • UPGRADE_TYPE=prerelease increments the prerelease component (e.g. 1.2.3 -> 1.2.4-rc, subsequent runs -> 1.2.4-rc.1, etc.).
  • No explicit outputs are exposed; derive the new version from the PR title or branch name if needed.

Examples

Caller mode

yaml
jobs:
  trigger-chart-update:
    uses: this-is-tobi/github-workflows/.github/workflows/update-helm-chart.yml@main
    with:
      RUN_MODE: caller
      WORKFLOW_NAME: update-app-version.yml
      CHART_REPO: this-is-tobi/helm-charts
      CHART_NAME: my-service
      APP_VERSION: 1.4.0
      UPGRADE_TYPE: minor
    secrets:
      GH_PAT: ${{ secrets.GH_PAT }}

Caller mode – prerelease bump

yaml
jobs:
  bump-chart-prerelease:
    uses: this-is-tobi/github-workflows/.github/workflows/update-helm-chart.yml@main
    with:
      RUN_MODE: caller
      WORKFLOW_NAME: update-app-version.yml
      CHART_REPO: this-is-tobi/helm-charts
      CHART_NAME: my-service
      APP_VERSION: 1.4.0-rc.1
      UPGRADE_TYPE: prerelease
      PRERELEASE_IDENTIFIER: rc
    secrets:
      GH_PAT: ${{ secrets.GH_PAT }}

Called mode

yaml
jobs:
  bump-chart:
    uses: this-is-tobi/github-workflows/.github/workflows/update-helm-chart.yml@main
    with:
      RUN_MODE: called
      CHART_NAME: my-service
      APP_VERSION: 1.4.0
      UPGRADE_TYPE: minor