From 44b23d1874f5cd0e94eb93f5630385be888b0500 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 21 Jun 2018 17:59:01 -0700 Subject: [PATCH] Fetch the pull request body using @sassbot's credentials (#375) This avoids running into GitHub's low rate limits for unauthenticated requests. --- .travis.yml | 3 +++ tool/travis/sass-spec-ref.sh | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 327813da..2a9d2a88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,6 +74,9 @@ jobs: env: &github-env - DART_CHANNEL=dev DART_VERSION=latest GITHUB_USER=sassbot # GITHUB_AUTH="..." + # + # Note that this overrides the read-only auth token that's set for all + # builds. - secure: "AAP74aT+8SQmwGeHrCsZ7GgppvCCkDAZXszivocMy3Fi9gfMCLABBCh67pGINJX4VlLW7ftPF3xivlvgGu+e4ncXz9m9jIPZ9Iza3cW5jCnCgyRGZD98gwabIDFWiv4X9V2xnJA2p1ZuYBf8Sh3TTipUFBKMjlnxVxYkIOTud4rUss/htFhxVA/oFTo0ThTZwXuxJ+GRGTM4PcuHPJvPf18iRPs2AHFV6ZP51xgc3AsXC6Zyom5EJeX0yGj9zWQ0XCjnuFdGsI6G9jmkrmqgAXuUipgqAn0tjxPYp9R/1HqnBLD3Zbrvyi5pCiSFclU6CS6kTDbefzPOc5+zrnlkaolVeF8tQ+EhZiZqtLnpLYUz9bgknoFUapUN4N0R36sKBStdRv54+sMeoOzpQ8ep3PeZW5nWbak12wcrDx38ToWs6hQ4ycb0SQDZZatHsASpSu2nX8HwzZSDAZmsAdB+epPmgA0CBjWVG1ycmVnT6l3OopUmbaY3pXBNzFUXq5Fcd7Q39/MfrmHpyxSc3QVf8xNtUx9ggYtK0Kwx6dgykhNMVzFGZRVyQgwpaiyDqgMGEU2GQzzcJhgKo9+y1fDtdfj/cctmvJ2Fo1fkk+DMkEPUHGOVo6uKFnartky9iLm1WiHDMruJ6SIOJzAnb+TMBWQTSwI+F4wyEiRVR8Zv4uA=" script: skip # Don't run tests deploy: diff --git a/tool/travis/sass-spec-ref.sh b/tool/travis/sass-spec-ref.sh index f48c94a8..ae296f7f 100755 --- a/tool/travis/sass-spec-ref.sh +++ b/tool/travis/sass-spec-ref.sh @@ -18,7 +18,15 @@ fi >&2 echo "Fetching pull request $TRAVIS_PULL_REQUEST..." -JSON=$(curl -L -sS https://api.github.com/repos/sass/dart-sass/pulls/$TRAVIS_PULL_REQUEST) +url=https://api.github.com/repos/sass/dart-sass/pulls/$TRAVIS_PULL_REQUEST +if [ -z "$GITHUB_AUTH" ]; then + >&2 echo "Fetching pull request info without authentication" + JSON=$(curl -L -sS $url) +else + >&2 echo "Fetching pull request info as sassbot" + JSON=$(curl -u "sassbot:$GITHUB_AUTH" -L -sS $url) +fi +>&2 echo "$JSON" RE_SPEC_PR="sass\/sass-spec(#|\/pull\/)([0-9]+)"