kube-linter-action
kube-linter-action copied to clipboard
use action with Kustomize
how do we use this with Kustomize repos?
This is a great question. Has the same issue.
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
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.