-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (40 loc) · 1.14 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:
pull_request:
types:
- opened
branches:
- gcp-baobab-prod
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
if ! helm lint $dir; then
failed_services+="'$(basename $dir)', "
fi
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