diff options
Diffstat (limited to 'scripts/go.sh')
-rwxr-xr-x | scripts/go.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/go.sh b/scripts/go.sh index e49d76c6d..626ed8fa4 100755 --- a/scripts/go.sh +++ b/scripts/go.sh @@ -25,10 +25,21 @@ tools/go_branch.sh # Checkout the new branch. git checkout go && git clean -f +go version + # Build everything. go build ./... # Push, if required. -if [[ "${KOKORO_GO_PUSH}" == "true" ]]; then +if [[ -v KOKORO_GO_PUSH ]] && [[ "${KOKORO_GO_PUSH}" == "true" ]]; then + if [[ -v KOKORO_GITHUB_ACCESS_TOKEN ]]; then + git config --global credential.helper cache + git credential approve <<EOF +protocol=https +host=github.com +username=$(cat "${KOKORO_KEYSTORE_DIR}/${KOKORO_GITHUB_ACCESS_TOKEN}") +password=x-oauth-basic +EOF + fi git push origin go:go fi |