Skip to content

Commit

Permalink
Add GHA workflow to lint helm chart, and fix a bug in the chart (#262)
Browse files Browse the repository at this point in the history
* ci: Add GHA workflow to lint helm chart

* fix: Quote ClusterRole apiGroups values in helm Chart

Valid apiGroup values, e.g. '*.mygroup.example.com', must be quoted in
the template.

Before this change, helm lint failed with this error:

[ERROR] templates/clusterrole.yaml: unable to parse YAML: error
converting YAML to JSON: yaml: line 92: did not find expected alphabetic
or numeric character
  • Loading branch information
dlipovetsky authored May 18, 2023
1 parent f0bd290 commit 29123c2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/lint-helm-chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint helm chart

on:
push:
branches:
- master
paths:
- 'helm/sloop/**'
pull_request:
branches:
- "*"
paths:
- 'helm/sloop/**'

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup helm
uses: azure/setup-helm@v3
with:
version: 'v3.12.0'

- name: Lint chart
run: |
helm lint helm/sloop
2 changes: 1 addition & 1 deletion helm/sloop/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ rules:
{{- with .Values.clusterRole.apiGroups }}
- apiGroups:
{{- range . }}
- {{ . }}
- {{ . | quote }}
{{- end }}
resources:
- '*'
Expand Down

0 comments on commit 29123c2

Please sign in to comment.