From a0f6c9361b6ad653ebee27b73d63cb966be33d40 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Thu, 25 Apr 2019 15:45:52 +0200 Subject: [PATCH] Check PRs for changelog entry in the body --- .travis.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3f7c856a7f7..ba8fad5f317 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,6 +88,19 @@ matrix: - os: windows script: + - | + if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then + output=$(curl -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$TRAVIS_PULL_REQUEST" | \ + python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \ + grep "changelog: " | \ + sed "s/changelog: //g") + if [ -z "$output" ]; then + echo "ERROR: PR body must contain 'changelog: ...'" + exit 1 + elif [ "$output" = "none" ]; then + echo "WARNING: changelog is 'none'" + fi + fi - | rm rust-toolchain ./setup-toolchain.sh