-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (43 loc) · 1.28 KB
/
ci.helm-lint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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