From 0bc5a883a4c7b93d803c8d1ff9504d7ae59edbcf Mon Sep 17 00:00:00 2001 From: Artyom Bakhtin Date: Thu, 6 Jul 2023 16:47:23 +0100 Subject: [PATCH] Update CI to fail if REAMDE.md was updated manually (#270) --- .github/workflows/pr.yaml | 12 ++++++++++-- .github/workflows/release.yaml | 2 +- charts/node/README.md | 7 ++++++- charts/node/README.md.gotmpl | 7 ++++++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a6d838ca..b071e1d1 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -27,11 +27,19 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v3.3 with: - version: v3.8.1 + version: v3.12.1 - uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" + + - name: Install pre-commit and helm-docs + run: | + pip install pre-commit==3.3.3 + curl -fSsL -o - https://github.com/norwoodj/helm-docs/releases/download/v1.11.0/helm-docs_1.11.0_Linux_x86_64.tar.gz | tar -xz -C /usr/local/bin helm-docs + + - name: Run pre-commit hooks + run: pre-commit run --all-files - name: Set up chart-testing uses: helm/chart-testing-action@v2.3.1 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dbdfccdc..fd6cd63e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,7 +22,7 @@ jobs: - name: Install Helm uses: azure/setup-helm@v3.3 with: - version: v3.8.1 + version: v3.12.1 - name: Install additional Helm repos run: | diff --git a/charts/node/README.md b/charts/node/README.md index d89bcabb..a7854bb1 100644 --- a/charts/node/README.md +++ b/charts/node/README.md @@ -3,7 +3,12 @@ DO NOT EDIT README.md manually! We're using [helm-docs](https://github.com/norwoodj/helm-docs) to render values of the chart. If you updated values.yaml file make sure to render a new README.md locally before submitting a Pull Request. -If you're using [pre-commit](https://pre-commit.com/) REAMDE.md will be updated automatically. +If you're using [pre-commit](https://pre-commit.com/) make sure to install the hooks first: +``` +pre-commit install +``` +REAMDE.md will be updating automatically after that. + Otherwise, you should install helm-docs and manually update README.md. Navigate to repository root and run: `helm-docs --chart-search-root=charts/node --template-files=README.md.gotmpl` diff --git a/charts/node/README.md.gotmpl b/charts/node/README.md.gotmpl index 8183ca4f..e669aa64 100644 --- a/charts/node/README.md.gotmpl +++ b/charts/node/README.md.gotmpl @@ -3,7 +3,12 @@ DO NOT EDIT README.md manually! We're using [helm-docs](https://github.com/norwoodj/helm-docs) to render values of the chart. If you updated values.yaml file make sure to render a new README.md locally before submitting a Pull Request. -If you're using [pre-commit](https://pre-commit.com/) REAMDE.md will be updated automatically. +If you're using [pre-commit](https://pre-commit.com/) make sure to install the hooks first: +``` +pre-commit install +``` +REAMDE.md will be updating automatically after that. + Otherwise, you should install helm-docs and manually update README.md. Navigate to repository root and run: `helm-docs --chart-search-root=charts/node --template-files=README.md.gotmpl`