Skip to content

Commit

Permalink
ci: add github action to check if helm docs is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaizet-ledger committed Aug 29, 2024
1 parent e65afe6 commit d669c99
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/helm-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Check Helm Docs

on:
pull_request:
paths:
- 'charts/**' # Only trigger on changes to charts

jobs:
check-helm-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Go environment
uses: actions/setup-go@v4
with:
go-version: '1.23' # Ensure you have a suitable Go version

- name: Install helm-docs
run: |
go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.14.2
- name: Run helm-docs
run: |
helm-docs
- name: Check for uncommitted changes
run: |
git diff --exit-code --ignore-all-space
continue-on-error: true
id: git_diff

- name: Display differences if found
if: steps.git_diff.outcome == 'failure'
run: |
echo "The following changes were detected:"
git diff --ignore-all-space
- name: Fail if helm-docs changes were needed
if: steps.git_diff.outcome == 'failure'
run: |
echo "::error::helm-docs was not applied or is outdated"
exit 1
- name: Success message
if: steps.git_diff.outcome == 'success'
run: |
echo "helm-docs is up-to-date"
2 changes: 1 addition & 1 deletion charts/balance-checker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
description: balance-checker helm charts
name: balance-checker
version: 0.0.1
version: 0.0.3
appVersion: v0.1.0
kubeVersion: ">=1.22.0-0"
maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/balance-checker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# balance-checker

![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)
![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

balance-checker helm charts

Expand Down

0 comments on commit d669c99

Please sign in to comment.