Skip to content

ci: add github action to check if helm docs is updated #7

ci: add github action to check if helm docs is updated

ci: add github action to check if helm docs is updated #7

Workflow file for this run

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/[email protected]
- 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"