Skip to content

Commit

Permalink
Use token to prevent rate limiting by Github API
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhave committed Apr 19, 2018
1 parent 5ecf339 commit 2e836ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ jobs:
BUILD_PIPELINE_NAME: ((pipeline-name))
BUILD_JOB_NAME: build
CONCOURSE_URL: ((concourse-url))
ACCESS_TOKEN: ((github-access-token))
- put: email-notification
params:
subject: email-details/subject
Expand All @@ -158,6 +159,7 @@ jobs:
BUILD_PIPELINE_NAME: ((pipeline-name))
BUILD_JOB_NAME: build
CONCOURSE_URL: ((concourse-url))
ACCESS_TOKEN: ((github-access-token))
- put: repo-status-build
params: { state: "success", commit: "git-repo" }
- put: email-notification
Expand Down Expand Up @@ -220,6 +222,7 @@ jobs:
BUILD_PIPELINE_NAME: ((pipeline-name))
BUILD_JOB_NAME: jdk9-build
CONCOURSE_URL: ((concourse-url))
ACCESS_TOKEN: ((github-access-token))
- put: email-notification
params:
subject: email-details/subject
Expand All @@ -233,6 +236,7 @@ jobs:
BUILD_PIPELINE_NAME: ((pipeline-name))
BUILD_JOB_NAME: jdk9-build
CONCOURSE_URL: ((concourse-url))
ACCESS_TOKEN: ((github-access-token))
- put: repo-status-jdk9-build
params: { state: "success", commit: "git-repo" }
- put: email-notification
Expand Down Expand Up @@ -279,6 +283,7 @@ jobs:
BUILD_PIPELINE_NAME: ((pipeline-name))
BUILD_JOB_NAME: jdk10-build
CONCOURSE_URL: ((concourse-url))
ACCESS_TOKEN: ((github-access-token))
- put: email-notification
params:
subject: email-details/subject
Expand All @@ -292,6 +297,7 @@ jobs:
BUILD_PIPELINE_NAME: ((pipeline-name))
BUILD_JOB_NAME: jdk10-build
CONCOURSE_URL: ((concourse-url))
ACCESS_TOKEN: ((github-access-token))
- put: repo-status-jdk10-build
params: { state: "success", commit: "git-repo" }
- put: email-notification
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/determine-email-body.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
pushd git-repo > /dev/null
PREV_SHA=$( git rev-parse HEAD^1 )
popd > /dev/null
PREV_STATUSES=$( curl https://api.github.com/repos/spring-projects/spring-boot/commits/$PREV_SHA/statuses )
PREV_STATUSES=$( curl https://api.github.com/repos/spring-projects/spring-boot/commits/$PREV_SHA/statuses -H "Authorization: token ${ACCESS_TOKEN}" )
PREV_STATES=$( echo $PREV_STATUSES | jq -r --arg BUILD_JOB_NAME "$BUILD_JOB_NAME" '.[] | select(.context == $BUILD_JOB_NAME) | .state' )
WAS_PREV_SUCCESSFUL=$( echo "$PREV_STATES" | grep 'success' || true )

Expand Down

0 comments on commit 2e836ac

Please sign in to comment.