Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.22.5' # 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"
Loading