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"