-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (41 loc) · 1.13 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
name: CI Helm Lint
on:
workflow_dispatch:
push:
branches:
- i-56/feat/ci-helm-lint
# pull_request:
# types:
# - closed
# branches:
# - main
# paths:
# - '**/*.yaml'
# - '**/templates/*.tpl'
# - '**/templates/*.yaml'
# - '**/**/templates/*.yaml'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run Helm lint
uses: WyriHaximus/github-action-helm3@v3
with:
exec: |
failed_services=""
for file in $(git diff --name-only HEAD~1..HEAD); do
dir=$(dirname $file)
if [ -f "$dir/Chart.yaml" ]; then
if ! helm lint $dir; then
echo "'$(basename $dir)' failed"
failed_services+="'$(basename $dir)', "
fi
fi
done
if [ -n "$failed_services" ]; then
# Remove the trailing comma and space
failed_services=${failed_services%??}
echo "Lint failed services: $failed_services"
fi