Skip to content

Commit a0f6c93

Browse files
committed
Check PRs for changelog entry in the body
1 parent a73bb33 commit a0f6c93

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,19 @@ matrix:
8888
- os: windows
8989

9090
script:
91+
- |
92+
if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then
93+
output=$(curl -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$TRAVIS_PULL_REQUEST" | \
94+
python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
95+
grep "changelog: " | \
96+
sed "s/changelog: //g")
97+
if [ -z "$output" ]; then
98+
echo "ERROR: PR body must contain 'changelog: ...'"
99+
exit 1
100+
elif [ "$output" = "none" ]; then
101+
echo "WARNING: changelog is 'none'"
102+
fi
103+
fi
91104
- |
92105
rm rust-toolchain
93106
./setup-toolchain.sh

0 commit comments

Comments
 (0)