From 61ca901e51be911ccc0664ffcfb908f8f477658b Mon Sep 17 00:00:00 2001 From: flip1995 Date: Sat, 15 Jun 2019 13:54:46 +0200 Subject: [PATCH] Get PR number from bors commit message --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6629f92a0908..12c9f512f569 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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")