kube-linter-action icon indicating copy to clipboard operation
kube-linter-action copied to clipboard

use action with Kustomize

Open Plork opened this issue 2 years ago • 3 comments

how do we use this with Kustomize repos?

Plork avatar Dec 09 '22 13:12 Plork

This is a great question. Has the same issue.

skabashnyuk avatar Jan 27 '23 15:01 skabashnyuk

I created a "composite" action in our organization that is a copy of this action.

I added this:

        set -u
        if [[ -z "${{ inputs.config }}" ]]; then
          CONFIG=""
        else
          CONFIG="--config ${{ inputs.config }}"
        fi
        if [[ "${{ inputs.kustomize }}" = "true" ]]; then
          ./kustomize build "${{ inputs.directory }}" | ./kube-linter $CONFIG lint - --format "${{ inputs.format }}"  | tee "${{ inputs.output-file }}"
        else
          ./kube-linter $CONFIG lint "${{ inputs.directory }}" --format "${{ inputs.format }}" | tee "${{ inputs.output-file }}"
        fi

https://docs.github.com/en/actions/creating-actions/creating-a-composite-action

Plork avatar Jan 27 '23 15:01 Plork

The problem that I faced is that in that case error is generated for the file that is not in the git repository. It is generated only during the build.

skabashnyuk avatar Jan 27 '23 18:01 skabashnyuk