-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (69 loc) · 2.29 KB
/
all-helm-lint.yml
File metadata and controls
79 lines (69 loc) · 2.29 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Helm Chart Lint
on:
workflow_call:
inputs:
chart_path:
description: 'Path to Helm chart directory'
required: true
type: string
helm_version:
description: 'Helm version to use'
required: false
type: string
default: 'v3.12.0'
chart_name:
description: 'Chart name for templating (defaults to chart directory name)'
required: false
type: string
default: ''
values_file:
description: 'Path to values file for templating validation'
required: false
type: string
default: ''
runs-on:
type: string
required: false
default: '["self-hosted", "ubuntu-22.04"]'
permissions:
contents: read
jobs:
lint:
name: Lint Helm Chart
runs-on: ${{ fromJSON(inputs.runs-on) }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Helm
uses: azure/setup-helm@v4
with:
version: ${{ inputs.helm_version }}
- name: Lint chart
run: |
echo "🔍 Linting Helm chart at ${{ inputs.chart_path }}..."
helm lint ${{ inputs.chart_path }}
echo "✅ Chart linting passed"
- name: Template chart
run: |
# Determine chart name (from input or extract from directory)
CHART_NAME="${{ inputs.chart_name }}"
if [ -z "$CHART_NAME" ]; then
CHART_NAME=$(basename ${{ inputs.chart_path }})
fi
echo "📋 Templating chart '$CHART_NAME' with default values..."
# Use custom values file if provided, otherwise use default
VALUES_FLAG=""
if [ -n "${{ inputs.values_file }}" ]; then
VALUES_FLAG="--values ${{ inputs.values_file }}"
elif [ -f "${{ inputs.chart_path }}/values.yaml" ]; then
VALUES_FLAG="--values ${{ inputs.chart_path }}/values.yaml"
fi
helm template "$CHART_NAME" ${{ inputs.chart_path }} $VALUES_FLAG
echo "✅ Chart templating passed"
- name: Package chart (validation only)
run: |
echo "📦 Packaging chart for validation..."
helm package ${{ inputs.chart_path }}
ls -la *.tgz
echo "✅ Chart packaging successful"