Skip to content

ci(helm): add chart checks and signed release to GHCR - #8

Open
simbrgr wants to merge 15 commits into
mainfrom
test/helm-signing-workflow
Open

simbrgr wants to merge 15 commits into
mainfrom
test/helm-signing-workflow

Conversation

@simbrgr

@simbrgr simbrgr commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

WHAT

Adds CI workflows for the Helm charts in helm/:

  • helm-release.yaml: Manually triggered release (workflow_dispatch), restricted to main. Packages the selected chart(s) (or all), pushes them as OCI artifacts to ghcr.io/project-construct-x/charts and signs the pushed digest keyless with Cosign. Existing versions are skipped, never overwritten. Dry run is enabled by default.
  • helm-checks.yaml: Runs on pushes to feature branches that touch helm/. Runs yamllint, ct lint and kubeconform. Charts are linted and rendered once per values-*-example.yaml, or with the chart defaults if a chart has no example values.
  • helm-pr-checks.yaml: Runs on pull requests that touch helm/. Runs ct lint on the changed charts only, using each values-*-example.yaml as a test case. A missing version bump produces a warning.
  • .github/actions/helm-setup: Composite action shared by all workflows. It installs Helm, detects valid chart directories (folders with a Chart.yaml), provides the shared yamllint config, adds the dependency repositories, builds the dependencies and prepares the example values for ct.

What the tools check:

  • yamllint: Style and syntax of all plain YAML files in helm/ (Chart.yaml, values.yaml, example values). Templates are excluded.
  • ct lint: Validates the Chart.yaml schema and runs helm lint once per example values file. Checks that the chart structure is valid and the templates render.
  • kubeconform: Validates the rendered manifests against the Kubernetes and CRD schemas.

WHY

  • Charts are currently not published as packages, and there is no automated validation before merging.
  • Releases should only be possible from reviewed code on main. The trigger stays manual so we decide what gets released.
  • Signing lets users verify that a chart was built by this repository's release workflow on main.

FURTHER NOTES

  • Example values must be named values-*-example.yaml, placed next to values.yaml.
  • Folders in helm/ without a Chart.yaml are ignored.
  • single-node is listed as a release option but currently has no Chart.yaml.
  • The push, sign and verify flow was tested against ghcr.io/project-construct-x/dev/charts/workflow-test. The test packages and test workflow runs are removed after merge.

Verifying a released chart:

cosign verify ghcr.io/project-construct-x/charts/<chart>:<version> \
  --certificate-identity 'https://github.com/project-construct-x/script-collection/.github/workflows/helm-release.yaml@refs/heads/main' \
  --certificate-oidc-issuer 'https://token.actions.githubusercontent.com'

Linked Issue(s)

Copilot AI 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.

🟡 Changes recommended

Critical workflow defects can prevent release jobs from starting, allow existing chart versions to be overwritten, and leave unsigned releases unrepairable through reruns.

4 open issues
What changed in this PR

Adds automated validation and a manual signed-release pipeline for the repository’s Helm charts.

Changes:

  • Adds chart linting, example-value rendering, and manifest validation.
  • Introduces main-only GHCR releases with Cosign signing and dry-run enabled by default.
  • Shares Helm setup across workflows and normalizes values-file formatting.
File Description
helm/​wallet/​values.yaml Removes trailing whitespace and adds a final newline.
helm/​issuer-wallet/​values.yaml Removes trailing whitespace and adds a final newline.
helm/​constructx-connector/​values.yaml Normalizes indentation, whitespace, and final newline.
.github/​workflows/​helm-release.yaml Adds manual packaging, GHCR publishing, and signing.
.github/​workflows/​helm-pr-checks.yaml Checks changed charts and warns about unchanged versions.
.github/​workflows/​helm-checks.yaml Adds push-triggered linting and manifest validation.
.github/​actions/​helm-setup/​action.yaml Shares chart discovery, dependency setup, and lint configuration.

Review effort: Balanced

prepare:
runs-on: ubuntu-latest
outputs:
charts: ${{ steps.list.outputs.charts }}
run: echo "::error::No valid Helm chart found for selection '${{ inputs.chart }}'" && exit 1

release:
needs: prepare
VERSION=$(yq .version "$CHART_DIR/Chart.yaml")
echo "name=$NAME" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
if helm show chart "oci://$REGISTRY/$NAME" --version "$VERSION" >/dev/null 2>&1; then

# Sign the digest and verify the signature against the identity of this workflow
- name: Sign and verify
if: steps.push.outcome == 'success'

This branch has not been deployed

No deployments
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