From f554590e9ad048573cf5442f1f4f17a977cd7d73 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Mon, 19 Sep 2022 13:13:20 +0200 Subject: [PATCH] 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 * remove auto generated date Signed-off-by: cpanato * disable auto generated tag in the docs Signed-off-by: cpanato Signed-off-by: cpanato --- .github/workflows/ci.yaml | 21 +++++++++++++++++++++ .gitignore | 1 + ct/cmd/root.go | 2 ++ doc/ct.md | 1 - doc/ct_install.md | 1 - doc/ct_lint-and-install.md | 1 - doc/ct_lint.md | 1 - doc/ct_list-changed.md | 1 - doc/ct_version.md | 1 - 9 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 406ba7d..66f53e9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -78,6 +78,27 @@ jobs: echo "Building snapshot..." ./build.sh + check-docs: + name: check-docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3 + - uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # v3 + with: + go-version-file: './go.mod' + check-latest: true + + - name: generate docs + run: | + go build -o ct-bin ./ct/main.go + ./ct-bin doc-gen + git_status="$(git status --porcelain)" + if [[ ${git_status} ]]; then + echo -e 'Documentation is outdated. Please update the docs\n' + echo "${git_status}" + exit 1 + fi + golangci: name: lint runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index f021794..2da204f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /dist /config.* vendor +/ct-bin diff --git a/ct/cmd/root.go b/ct/cmd/root.go index c792c81..ea69004 100644 --- a/ct/cmd/root.go +++ b/ct/cmd/root.go @@ -49,6 +49,8 @@ func NewRootCmd() *cobra.Command { cmd.AddCommand(newVersionCmd()) cmd.AddCommand(newGenerateDocsCmd()) + cmd.DisableAutoGenTag = true + return cmd } diff --git a/doc/ct.md b/doc/ct.md index 3a307c0..375b140 100644 --- a/doc/ct.md +++ b/doc/ct.md @@ -26,4 +26,3 @@ in given chart directories. * [ct list-changed](ct_list-changed.md) - List changed charts * [ct version](ct_version.md) - Print version information -###### Auto generated by spf13/cobra on 23-Mar-2022 diff --git a/doc/ct_install.md b/doc/ct_install.md index 9263a69..2f66669 100644 --- a/doc/ct_install.md +++ b/doc/ct_install.md @@ -78,4 +78,3 @@ ct install [flags] * [ct](ct.md) - The Helm chart testing tool -###### Auto generated by spf13/cobra on 23-Mar-2022 diff --git a/doc/ct_lint-and-install.md b/doc/ct_lint-and-install.md index 4793194..df4ed9b 100644 --- a/doc/ct_lint-and-install.md +++ b/doc/ct_lint-and-install.md @@ -77,4 +77,3 @@ ct lint-and-install [flags] * [ct](ct.md) - The Helm chart testing tool -###### Auto generated by spf13/cobra on 23-Mar-2022 diff --git a/doc/ct_lint.md b/doc/ct_lint.md index 3b5fa3d..c7e5519 100644 --- a/doc/ct_lint.md +++ b/doc/ct_lint.md @@ -74,4 +74,3 @@ ct lint [flags] * [ct](ct.md) - The Helm chart testing tool -###### Auto generated by spf13/cobra on 23-Mar-2022 diff --git a/doc/ct_list-changed.md b/doc/ct_list-changed.md index 87c8442..3fa32c0 100644 --- a/doc/ct_list-changed.md +++ b/doc/ct_list-changed.md @@ -32,4 +32,3 @@ ct list-changed [flags] * [ct](ct.md) - The Helm chart testing tool -###### Auto generated by spf13/cobra on 23-Mar-2022 diff --git a/doc/ct_version.md b/doc/ct_version.md index 409e64e..7e5fc71 100644 --- a/doc/ct_version.md +++ b/doc/ct_version.md @@ -16,4 +16,3 @@ ct version [flags] * [ct](ct.md) - The Helm chart testing tool -###### Auto generated by spf13/cobra on 23-Mar-2022