From e44725a4a26ef3b62624aaa74762c28be6d7ebd6 Mon Sep 17 00:00:00 2001 From: Alex Stephen Date: Mon, 25 Feb 2019 14:48:31 -0800 Subject: [PATCH] only run go mod vendor if git differences --- .ci/magic-modules/generate-terraform.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/magic-modules/generate-terraform.sh b/.ci/magic-modules/generate-terraform.sh index cbc80dd03857..9bf7e0c3b9e7 100755 --- a/.ci/magic-modules/generate-terraform.sh +++ b/.ci/magic-modules/generate-terraform.sh @@ -49,7 +49,11 @@ fi pushd "build/$SHORT_NAME" -GO111MODULE=on go mod vendor +# go mod vendor is a very expensive operation. +# If no changes, avoid running. +if git diff-index --quiet HEAD --; then + GO111MODULE=on go mod vendor +fi # These config entries will set the "committer". git config --global user.email "magic-modules@google.com"