From 2892bbd07a909feb928ed5f61d1705adff4f279a Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 4 Jul 2016 12:32:45 -0500 Subject: [PATCH] travis: support nox 0.0.4 arguments This adds the "slug" arguments and also the "token" argument. The slug argument provides the "owner_name/repo_name" format base repo to use for the pull request. The token argument provides the GitHub presonal access token to use for the requests to the GitHub API. --- maintainers/scripts/travis-nox-review-pr.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/maintainers/scripts/travis-nox-review-pr.sh b/maintainers/scripts/travis-nox-review-pr.sh index 791a50b0ae8..a992311436c 100755 --- a/maintainers/scripts/travis-nox-review-pr.sh +++ b/maintainers/scripts/travis-nox-review-pr.sh @@ -32,7 +32,12 @@ while test -n "$1"; do else echo "=== Building pull request #$TRAVIS_PULL_REQUEST" - nix-shell --packages nox git --run "nox-review pr $TRAVIS_PULL_REQUEST" -I nixpkgs=$TRAVIS_BUILD_DIR + token="" + if [ -n "$GITHUB_TOKEN" ]; then + token="--token $GITHUB_TOKEN" + fi + + nix-shell --packages nox git --run "nox-review pr --slug $TRAVIS_REPO_SLUG $token $TRAVIS_PULL_REQUEST" -I nixpkgs=$TRAVIS_BUILD_DIR fi ;;