From 19b77ad50757f1662dcacec4ad079013ac362272 Mon Sep 17 00:00:00 2001 From: Sebastian Spaink <3441183+sspaink@users.noreply.github.com> Date: Tue, 12 Jul 2022 15:30:53 -0500 Subject: [PATCH] chore: Check for readme changes in each PR (#11495) --- .circleci/config.yml | 1 + .github/PULL_REQUEST_TEMPLATE.md | 11 ++++++++++- CONTRIBUTING.md | 5 +++-- scripts/make_docs.sh | 10 ++++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100755 scripts/make_docs.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 6dd5e7fbf..ead07e351 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -180,6 +180,7 @@ jobs: - restore_cache: key: go-mod-v1-{{ checksum "go.sum" }} - check-changed-files-or-halt + - run: ./scripts/make_docs.sh - run: 'make deps' - run: 'make tidy' - run: 'make check' diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 67b65a262..88be554bd 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,13 @@ -### Required for all PRs: +# Required for all PRs + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4323b07ca..c26a18050 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,12 +68,13 @@ Telegraf uses Go modules. Assuming you can already build the project, run this i **Unit Tests:** -Before opening a pull request you should run the linter checks and -the short tests. +Before opening a pull request you should run the following checks to make sure the CI will pass. ```shell make check +make check-deps make test +make docs ``` **Execute integration tests:** diff --git a/scripts/make_docs.sh b/scripts/make_docs.sh new file mode 100755 index 000000000..a17fa437c --- /dev/null +++ b/scripts/make_docs.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +make docs + +if [ "$(git status --porcelain | wc -l)" -eq "0" ]; then + echo "🟢 Git repo is clean." +else + echo "🔴 Git repo dirty. Please run \"make docs\" and push the updated README. Failing CI." + exit 1 +fi