Skip to content

trigger lint

trigger lint #3

Workflow file for this run

name: Helm Lint
on:
pull_request:
branches:
- main
paths:
- apps/**
- platform-apps/**
types:
- opened
- reopened
- synchronize
jobs:
helm-check:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Install packages
run: |
apt update
apt install -y git unzip
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.10.1
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@8238a4103220c636f2dad328ead8a7c8dbe316a3 # v39.2.0
with:
files: |
apps/**
platform-apps/**
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Helm lint check
if: steps.changed-files.outputs.any_changed == 'true'
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
chart=$(echo $file | cut -d/ -f 1-2)
values_dir="$chart/values"
# Check and lint values in the 'values' directories
if [[ -d "$values_dir" ]]; then
for value_file in $(find "$values_dir" -type f); do
echo "helm lint $chart -f $value_file"
helm lint "$chart" -f "$value_file"
done
fi
# Fallback to lint the chart without specific value files if none of the directories exist
if [[ ! -d "$values_dir" ]]; then
helm lint "$chart"
fi
done
shell: bash