Automator: update common-files@master in istio/istio.io@master (#11050)

This commit is contained in:
Istio Automation 2022-03-14 14:37:16 -07:00 committed by GitHub
parent b5952bbdfe
commit c702c2d96f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 2 deletions

View File

@ -1 +1 @@
4f7a47a2619aa100ebdec34dc4a0369204c1c01c
4023d4ecadf17e8b274212b8c7285ee0e6e9b4fe

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 2019 Istio Authors
# Copyright Istio Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -14,9 +14,32 @@
# See the License for the specific language governing permissions and
# limitations under the License.
function write_patch_file() {
if [ -z "${ARTIFACTS}" ]; then
return 0
fi
PATCH_NAME="check-clean-repo-diff.patch"
PATCH_OUT="${ARTIFACTS}/${PATCH_NAME}"
git diff > "${PATCH_OUT}"
[ -n "${JOB_NAME}" ] && [ -n "${BUILD_ID}" ]
IN_PROW="$?"
# Don't persist large diffs (30M+) on CI
LARGE_FILE="$(find "${ARTIFACTS}" -name "${PATCH_NAME}" -type 'f' -size +30M)"
if [ "${IN_PROW}" -eq 0 ] && [ -n "${LARGE_FILE}" ]; then
rm "${PATCH_OUT}"
echo "WARNING: patch file was too large to persist ($(du -h "${PATCH_OUT}"))"
return 0
fi
echo "You can also try applying the patch file from the build artifacts."
}
if [[ -n $(git status --porcelain) ]]; then
git status
git diff
echo "ERROR: Some files need to be updated, please run 'make gen' and include any changed files in your PR"
write_patch_file
exit 1
fi