Skip to content

Commit ab3df06

Browse files
ci: add github action to check if helm docs is updated
1 parent e65afe6 commit ab3df06

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

.github/workflows/helm-docs.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Check Helm Docs
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'charts/**' # Only trigger on changes to charts
7+
8+
jobs:
9+
check-helm-docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Go environment
16+
uses: actions/setup-go@v4
17+
with:
18+
go-version: '1.23' # Ensure you have a suitable Go version
19+
20+
- name: Install helm-docs
21+
run: |
22+
go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest
23+
24+
- name: Run helm-docs
25+
run: |
26+
helm-docs
27+
28+
- name: Check for uncommitted changes
29+
run: |
30+
git diff --exit-code
31+
continue-on-error: true
32+
id: git_diff
33+
34+
- name: Display differences if found
35+
if: steps.git_diff.outcome == 'failure'
36+
run: |
37+
echo "The following changes were detected:"
38+
git diff
39+
40+
- name: Fail if helm-docs changes were needed
41+
if: steps.git_diff.outcome == 'failure'
42+
run: |
43+
echo "::error::helm-docs was not applied or is outdated"
44+
exit 1
45+
46+
- name: Success message
47+
if: steps.git_diff.outcome == 'success'
48+
run: |
49+
echo "helm-docs is up-to-date"

charts/balance-checker/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v2
33
description: balance-checker helm charts
44
name: balance-checker
5-
version: 0.0.1
5+
version: 0.0.3
66
appVersion: v0.1.0
77
kubeVersion: ">=1.22.0-0"
88
maintainers:

0 commit comments

Comments
 (0)