Skip to content

Commit f554590

Browse files
authored
add job to check if docs are up to date (#473)
* add job to check if docs are up to date Signed-off-by: cpanato <[email protected]> * remove auto generated date Signed-off-by: cpanato <[email protected]> * disable auto generated tag in the docs Signed-off-by: cpanato <[email protected]> Signed-off-by: cpanato <[email protected]>
1 parent 68f3fff commit f554590

File tree

9 files changed

+24
-6
lines changed

9 files changed

+24
-6
lines changed

.github/workflows/ci.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,27 @@ jobs:
7878
echo "Building snapshot..."
7979
./build.sh
8080
81+
check-docs:
82+
name: check-docs
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3
86+
- uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # v3
87+
with:
88+
go-version-file: './go.mod'
89+
check-latest: true
90+
91+
- name: generate docs
92+
run: |
93+
go build -o ct-bin ./ct/main.go
94+
./ct-bin doc-gen
95+
git_status="$(git status --porcelain)"
96+
if [[ ${git_status} ]]; then
97+
echo -e 'Documentation is outdated. Please update the docs\n'
98+
echo "${git_status}"
99+
exit 1
100+
fi
101+
81102
golangci:
82103
name: lint
83104
runs-on: ubuntu-latest

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/dist
66
/config.*
77
vendor
8+
/ct-bin

ct/cmd/root.go

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ func NewRootCmd() *cobra.Command {
4949
cmd.AddCommand(newVersionCmd())
5050
cmd.AddCommand(newGenerateDocsCmd())
5151

52+
cmd.DisableAutoGenTag = true
53+
5254
return cmd
5355
}
5456

doc/ct.md

-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ in given chart directories.
2626
* [ct list-changed](ct_list-changed.md) - List changed charts
2727
* [ct version](ct_version.md) - Print version information
2828

29-
###### Auto generated by spf13/cobra on 23-Mar-2022

doc/ct_install.md

-1
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,3 @@ ct install [flags]
7878

7979
* [ct](ct.md) - The Helm chart testing tool
8080

81-
###### Auto generated by spf13/cobra on 23-Mar-2022

doc/ct_lint-and-install.md

-1
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,3 @@ ct lint-and-install [flags]
7777

7878
* [ct](ct.md) - The Helm chart testing tool
7979

80-
###### Auto generated by spf13/cobra on 23-Mar-2022

doc/ct_lint.md

-1
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,3 @@ ct lint [flags]
7474

7575
* [ct](ct.md) - The Helm chart testing tool
7676

77-
###### Auto generated by spf13/cobra on 23-Mar-2022

doc/ct_list-changed.md

-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ ct list-changed [flags]
3232

3333
* [ct](ct.md) - The Helm chart testing tool
3434

35-
###### Auto generated by spf13/cobra on 23-Mar-2022

doc/ct_version.md

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ ct version [flags]
1616

1717
* [ct](ct.md) - The Helm chart testing tool
1818

19-
###### Auto generated by spf13/cobra on 23-Mar-2022

0 commit comments

Comments
 (0)