1*af546375SCole Faust#!/bin/bash 2*af546375SCole Faust# Copyright 2020 Google LLC 3*af546375SCole Faust# 4*af546375SCole Faust# Licensed under the Apache License, Version 2.0 (the "License"); 5*af546375SCole Faust# you may not use this file except in compliance with the License. 6*af546375SCole Faust# You may obtain a copy of the License at 7*af546375SCole Faust# 8*af546375SCole Faust# http://www.apache.org/licenses/LICENSE-2.0 9*af546375SCole Faust# 10*af546375SCole Faust# Unless required by applicable law or agreed to in writing, software 11*af546375SCole Faust# distributed under the License is distributed on an "AS IS" BASIS, 12*af546375SCole Faust# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*af546375SCole Faust# See the License for the specific language governing permissions and 14*af546375SCole Faust# limitations under the License. 15*af546375SCole Faust 16*af546375SCole Faustset -eo pipefail 17*af546375SCole Faust 18*af546375SCole Faustcd ${KOKORO_ARTIFACTS_DIR}/github/google-auth-library-java 19*af546375SCole Faust 20*af546375SCole Faust# Disable buffering, so that the logs stream through. 21*af546375SCole Faustexport PYTHONUNBUFFERED=1 22*af546375SCole Faust 23*af546375SCole Faust# Kokoro exposes this as a file, but the scripts expect just a plain variable. 24*af546375SCole Faustexport GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) 25*af546375SCole Faust 26*af546375SCole Faust# Setup git credentials 27*af546375SCole Faustecho "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials 28*af546375SCole Faustgit config --global credential.helper 'store --file ~/.git-credentials' 29*af546375SCole Faust 30*af546375SCole Faustpython3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool 31*af546375SCole Faust 32*af546375SCole Faustset +e 33*af546375SCole Faustpython3.6 -m autosynth.synth \ 34*af546375SCole Faust --repository=googleapis/google-auth-library-java \ 35*af546375SCole Faust --synth-file-name=.github/readme/synth.py \ 36*af546375SCole Faust --metadata-path=.github/readme/synth.metadata \ 37*af546375SCole Faust --pr-title="chore: regenerate README" \ 38*af546375SCole Faust --branch-suffix="readme" 39*af546375SCole Faust 40*af546375SCole Faust# autosynth returns 28 to signal there are no changes 41*af546375SCole FaustRETURN_CODE=$? 42*af546375SCole Faustif [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] 43*af546375SCole Faustthen 44*af546375SCole Faust exit ${RETURN_CODE} 45*af546375SCole Faustfi 46