Skip to content

Commit 1a869e6

Browse files
committed
Get PR number from bors commit message
1 parent 4a3f597 commit 1a869e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ matrix:
9595
script:
9696
- |
9797
if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then
98-
output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$TRAVIS_PULL_REQUEST" | \
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" | \
99100
python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
100101
grep "changelog: " | \
101102
sed "s/changelog: //g")

0 commit comments

Comments
 (0)