-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 1.97 KB
/
docs.yaml
File metadata and controls
65 lines (58 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Generate Documentation
on:
pull_request:
paths:
- 'charts/**/values.yaml'
- 'charts/**/Chart.yaml'
- 'charts/**/README.md.gotmpl'
push:
branches:
- main
paths:
- 'charts/**/values.yaml'
- 'charts/**/Chart.yaml'
- 'charts/**/README.md.gotmpl'
jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Install helm-docs
run: |
wget https://github.com/norwoodj/helm-docs/releases/download/v1.13.1/helm-docs_1.13.1_Linux_x86_64.tar.gz
tar -xzf helm-docs_1.13.1_Linux_x86_64.tar.gz
sudo mv helm-docs /usr/local/bin/
- name: Run helm-docs
run: helm-docs --chart-search-root=charts
- name: Check for changes
id: changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit changes (push to main)
if: github.event_name == 'push' && steps.changes.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add charts/*/README.md
git commit -m "docs: auto-generate chart documentation"
git push
- name: Comment on PR
if: github.event_name == 'pull_request' && steps.changes.outputs.changed == 'true'
uses: actions/github-script@v8
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: '⚠️ **Documentation out of date**\n\nPlease run `helm-docs` locally or documentation will be auto-updated on merge.'
})