Skip to content

Commit 9ed45f4

Browse files
committed
Auto merge of #4211 - flip1995:check_changelog, r=<try>
Check for changelog entry in PR bodies cc #4031 but now on the auto and try branches. (#3955 (comment)) changelog: none
2 parents be5d17f + 1b34193 commit 9ed45f4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ branches:
1717
env:
1818
global:
1919
- RUST_BACKTRACE=1
20+
- secure: "OKulfkA5OGd/d1IhvBKzRkHQwMcWjzrzbimo7+5NhkUkWxndAzl+719TB3wWvIh1i2wXXrEXsyZkXM5FtRrHm55v1VKQ5ibjEvFg1w3NIg81iDyoLq186fLqywvxGkOAFPrsePPsBj5USd5xvhwwbrjO6L7/RK6Z8shBwOSc41s="
2021

2122
install:
2223
- |
@@ -92,6 +93,20 @@ matrix:
9293
- os: windows
9394

9495
script:
96+
- |
97+
if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then
98+
pr=$(echo $TRAVIS_COMMIT_MESSAGE | grep -o "#[0-9]*" | head -1 | sed 's/^#//g')
99+
output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$pr" | \
100+
python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
101+
grep "changelog: " | \
102+
sed "s/changelog: //g")
103+
if [ -z "$output" ]; then
104+
echo "ERROR: PR body must contain 'changelog: ...'"
105+
exit 1
106+
elif [ "$output" = "none" ]; then
107+
echo "WARNING: changelog is 'none'"
108+
fi
109+
fi
95110
- |
96111
rm rust-toolchain
97112
./setup-toolchain.sh

0 commit comments

Comments
 (0)