Get PR number from bors commit message

This commit is contained in:
flip1995 2019-06-15 13:54:46 +02:00
parent cb6cec5695
commit 61ca901e51
No known key found for this signature in database
GPG Key ID: 693086869D506637

View File

@ -91,7 +91,8 @@ matrix:
script:
- |
if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then
output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$TRAVIS_PULL_REQUEST" | \
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")