Skip to content

feat(helm-lint): fix lint step id, make lint opt-in with registry login - #115

Open
shimoncohen wants to merge 5 commits into
masterfrom
fix/helm-lint-step-id
Open

shimoncohen wants to merge 5 commits into
masterfrom
fix/helm-lint-step-id

Conversation

@shimoncohen

@shimoncohen shimoncohen commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Lint never ran: the lint/install steps referenced steps.list-changed while the step id was list_changed.

Fixing only the id would make lint fail in most consumers (ct lint builds dependencies from the OCI registry), so lint is now opt-in:

  • New inputs registry, username, password. When all are set, the action logs in to the registry and lints changed charts; otherwise it only lists changed charts, as today.
  • install input (default false) gates the kind cluster and ct install.
  • Bundled ct.yaml (no version-bump or maintainers check) and lintconf.yaml (brackets, comments, trailing-spaces only warn).
  • test-helm-lint.yml: chartPaths: test (./test/helm made ct find no charts), removed the nonexistent repository input, passes the org ACR secrets.

To opt in, add registry, username, password from the org secrets ACR_URL, ACR_PUSH_USER, ACR_PUSH_TOKEN (see README).

🤖 Generated with Claude Code

The step id was list_changed while every condition and the changed
output read steps.list-changed, so lint and install were always skipped.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shimoncohen shimoncohen changed the title fix(helm-lint): match list-changed step id so lint and install run feat(helm-lint): make lint actually run, without breaking consumers Oct 18, 2026
Lint (and install) run only when registry, username and password are
set, since ct lint builds dependencies from the OCI registry. Repos that
don't pass them keep passing as today. Bundle ct.yaml (no version-bump
or maintainers check) and a lintconf that only warns on brackets,
comments and trailing-spaces.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shimoncohen
shimoncohen force-pushed the fix/helm-lint-step-id branch from 69e6723 to aaf644c Compare October 18, 2026 11:12
@shimoncohen shimoncohen changed the title feat(helm-lint): make lint actually run, without breaking consumers feat(helm-lint): fix lint step id, make lint opt-in with registry login Oct 18, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shimoncohen

Copy link
Copy Markdown
Contributor Author

Tested the action at 17b1521 in consumer repos:

MapColonies/qgis-server#7 and MapColonies/nginx-s3-gateway#39 were throwaway PRs, now closed.

Comment thread .github/workflows/test-helm-lint.yml
Comment thread .github/workflows/test-helm-lint.yml Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick]: this prints "linted" even when lint was skipped because there were no credentials (fork PRs, Dependabot). Maybe "Charts were changed." or check the lint result instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 09a69d9: now "Charts were changed."

Comment thread actions/helm-lint/lintconf.yaml Outdated
Comment thread actions/helm-lint/action.yaml Outdated
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --chart-dirs "${{ inputs.chartPaths }}" --target-branch "${{ github.base_ref || github.event.repository.default_branch }}"
if: steps.login.outcome == 'success'
run: ct lint --config "${{ github.action_path }}/ct.yaml" --lint-conf "${{ github.action_path }}/lintconf.yaml" --chart-dirs "${{ inputs.chartPaths }}" --target-branch "${{ github.base_ref || github.event.repository.default_branch }}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] (pre-existing, but these lines are rewritten here): the credentials nicely go through env:. Could inputs.chartPaths and the target branch do the same, per GitHub's script-injection guidance? update-artifacts-file already follows this pattern.

      env:
        CHART_DIRS: ${{ inputs.chartPaths }}
        TARGET_BRANCH: ${{ github.base_ref || github.event.repository.default_branch }}
      run: ct lint --config "$GITHUB_ACTION_PATH/ct.yaml" --lint-conf "$GITHUB_ACTION_PATH/lintconf.yaml" --chart-dirs "$CHART_DIRS" --target-branch "$TARGET_BRANCH"

Same applies to list-changed (line 47) and install (line 80).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 09a69d9: list-changed, lint, install read CHART_DIRS/TARGET_BRANCH from env: and use $GITHUB_ACTION_PATH.

Comment thread actions/helm-lint/action.yaml
Comment thread actions/helm-lint/README.md Outdated
- lintconf.yaml: ct's etc/lintconf.yaml verbatim; only brackets, comments
  and trailing-spaces downgraded to warning.
- Pass chartPaths and target branch via env, log out of the registry after
  a successful login.
- test-helm-lint: trigger on test/helm, touch the test chart so
  list-changed always picks it up, restore fixture templates mangled by
  prettier, add missing secret values.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment thread test/helm/templates/deployment.yaml Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] install: true can't be tested with this fixture: Kubernetes rejects restartPolicy: Never on a Deployment (Unsupported value: "Never": supported values: "Always", found with act + kind). Dropping the line, or a sleep command instead of echo, would make the fixture installable if we want a self-test for install later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in cb9e827: removed restartPolicy: Never.

Deployments only accept restartPolicy Always, so the fixture could not be
installed with install: true.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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