File tree 4 files changed +52
-0
lines changed
4 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ SCRIPTPATH=$( dirname " $0 " )
6
+ HELM_DOCS_VERSION=" 1.11.0"
7
+
8
+ function install_helm_docs {
9
+ case " $( uname -s) " in
10
+ Linux* )
11
+ machine=Linux
12
+ shasum=sha256sum
13
+ ;;
14
+ Darwin* )
15
+ machine=Darwin
16
+ shasum=shasum
17
+ ;;
18
+ esac
19
+
20
+ curl -LO https://github.com/norwoodj/helm-docs/releases/download/v" ${HELM_DOCS_VERSION} " /helm-docs_" ${HELM_DOCS_VERSION} " _${machine} _x86_64.tar.gz
21
+ curl -L --output /tmp/checksums_helm-docs.txt https://github.com/norwoodj/helm-docs/releases/download/v${HELM_DOCS_VERSION} /checksums.txt
22
+ grep helm-docs_${HELM_DOCS_VERSION} _${machine} _x86_64.tar.gz /tmp/checksums_helm-docs.txt | $shasum -c -
23
+ mkdir -p " $SCRIPTPATH /bin"
24
+ tar -xf helm-docs_" ${HELM_DOCS_VERSION} " _${machine} _x86_64.tar.gz helm-docs
25
+ mv helm-docs " $SCRIPTPATH /bin/"
26
+ rm helm-docs_" ${HELM_DOCS_VERSION} " _${machine} _x86_64.tar.gz
27
+ }
28
+
29
+ if [ ! -f " $SCRIPTPATH /bin/helm-docs" ] ; then
30
+ install_helm_docs
31
+ elif [[ ! " $( " $SCRIPTPATH /bin/helm-docs" --version) " =~ .* " $HELM_DOCS_VERSION " .* ]] ; then
32
+ install_helm_docs
33
+ else
34
+ echo " Using '$( " $SCRIPTPATH /bin/helm-docs" --version) '"
35
+ fi
36
+
37
+ # validate docs
38
+ " $SCRIPTPATH /bin/helm-docs" -t " $SCRIPTPATH /README.md.tmpl" -g $1
39
+ git diff --exit-code
Original file line number Diff line number Diff line change 4
4
pull_request :
5
5
paths :
6
6
- " .github/workflows/test.yml"
7
+ - " .github/helm-docs.sh"
7
8
- " charts/**"
8
9
9
10
jobs :
46
47
git diff --exit-code
47
48
working-directory : ${{ matrix.chart }}
48
49
50
+ - name : Check docs updated
51
+ run : .github/helm-docs.sh .
52
+ working-directory : ${{ matrix.chart }}
53
+
49
54
test :
50
55
runs-on : ubuntu-latest
51
56
steps :
Original file line number Diff line number Diff line change @@ -3,3 +3,5 @@ charts/*/Chart.lock
3
3
4
4
# Vim swap files
5
5
* .swp
6
+
7
+ .github /bin
Original file line number Diff line number Diff line change @@ -57,5 +57,11 @@ Any changes to Chart.yaml or values.yaml require an update of the README.md. Thi
57
57
helm-docs -g charts/«chart-name»
58
58
```
59
59
60
+ or
61
+
62
+ ``` shell
63
+ .github/helm-docs.sh charts/«chart-name»
64
+ ```
65
+
60
66
[ crane ] : https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane.md " Crane is a tool for managing container images "
61
67
[ helm-docs ] : https://github.com/norwoodj/helm-docs " The helm-docs tool auto-generates documentation from helm charts into markdown files. "
You can’t perform that action at this time.
0 commit comments