Skip to content

CI Helm Lint

CI Helm Lint #204

Workflow file for this run

name: CI Helm Lint
on:
workflow_dispatch:
pull_request:
types:
- opened
branches:
- main
- feat/unifying-branches
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run Helm lint
uses: WyriHaximus/github-action-helm3@v3
id: lint
with:
exec: |
failed_services=""
for file in $(git diff --name-only HEAD~1..HEAD); do
dir=$(dirname $file)
if [ -f "$dir/Chart.yaml" ]; then
for values_file in $(ls $dir/values*.yaml 2>/dev/null); do
if ! helm_lint $dir -f "$values_file"; then
failed_services+="'$(basename $dir)', "
fi
done
fi
done
if [ -n "$failed_services" ]; then
# Remove the trailing comma and space
failed_services=${failed_services%??}
echo "failed_services=$failed_services" >> $GITHUB_OUTPUT
fi
- name: Failed services
if: steps.lint.outputs.failed_services
run: |
echo "Failed services: ${{ steps.lint.outputs.failed_services }}"
exit 1