From 7db8a6c5ffb12a6e4c2f799c18f00f7f3d60e279 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 9 Nov 2020 14:51:28 -0800 Subject: [PATCH] chore(java): ignore return code 28 in README autosynth job (#843) Exit code 28 is returned if no changes are required and should not be considered a failure. --- .../gcp/templates/java_library/.kokoro/readme.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/synthtool/gcp/templates/java_library/.kokoro/readme.sh b/synthtool/gcp/templates/java_library/.kokoro/readme.sh index 295391969..d41067016 100755 --- a/synthtool/gcp/templates/java_library/.kokoro/readme.sh +++ b/synthtool/gcp/templates/java_library/.kokoro/readme.sh @@ -28,9 +28,18 @@ echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials git config --global credential.helper 'store --file ~/.git-credentials' python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool + +set +e python3.6 -m autosynth.synth \ --repository={{metadata['repo']['repo']}} \ --synth-file-name=.github/readme/synth.py \ --metadata-path=.github/readme/synth.metadata \ --pr-title="chore: regenerate README" \ - --branch-suffix="readme" \ No newline at end of file + --branch-suffix="readme" + +# autosynth returns 28 to signal there are no changes +RETURN_CODE=$? +if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] +then + exit ${RETURN_CODE} +fi