Skip to content

Commit

Permalink
Auto merge of rust-lang#4211 - flip1995:check_changelog, r=matthiaskrgr
Browse files Browse the repository at this point in the history
Check for changelog entry in PR bodies

cc rust-lang#4031 but now on the auto and try branches. (rust-lang/rust-clippy#3955 (comment))

changelog: none
  • Loading branch information
bors committed Jul 15, 2019
2 parents a73bb33 + 1c87df4 commit e294815
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ branches:
env:
global:
- RUST_BACKTRACE=1
- secure: "OKulfkA5OGd/d1IhvBKzRkHQwMcWjzrzbimo7+5NhkUkWxndAzl+719TB3wWvIh1i2wXXrEXsyZkXM5FtRrHm55v1VKQ5ibjEvFg1w3NIg81iDyoLq186fLqywvxGkOAFPrsePPsBj5USd5xvhwwbrjO6L7/RK6Z8shBwOSc41s="

install:
- |
Expand Down Expand Up @@ -88,6 +89,20 @@ matrix:
- os: windows

script:
- |
if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then
pr=$(echo $TRAVIS_COMMIT_MESSAGE | grep -o "#[0-9]*" | head -1 | sed 's/^#//g')
output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$pr" | \
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
Expand Down

0 comments on commit e294815

Please sign in to comment.