From 85f148572825b0a6771fc66d68cdbc2b7ee4d334 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 26 Jun 2015 16:13:37 -0700 Subject: [PATCH] Add travis test to check for any /README.md changes - the :'' is to ensure the yml parser doesn't think it is a mapped value --- .travis.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2d50d7b9..0f22ff3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ install: script: - files="$(find -name '*.md' -print0 | xargs -0 markdownfmt -l)"; if [ "$files" ]; then - echo >&2 "Need markdownfmt:"; + echo >&2 'Need markdownfmt:'; echo >&2 "$files"; echo >&2; echo "$files" | xargs markdownfmt -d >&2; @@ -28,3 +28,13 @@ script: echo >&2 "Too long (or too many lines):$failed"; exit 1; fi + - if [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then + if [ "$(git diff --numstat "$TRAVIS_COMMIT_RANGE" -- '*/README.md')" ]; then + echo >&2 'Error:'' at least one repo README.md has changed'; + echo >&2 'These files are autogenerated, so it is unnecessary to modify them'; + echo >&2 'Please update content.md and docker-library-bot will take care of README.md'; + echo >&2 'See:'' https://github.com/docker-library/docs/#image-namereadmemd'; + echo >&2; + exit 1; + fi + fi