diff --git a/ci-operator/config/app-sre/infra/app-sre-infra-main.yaml b/ci-operator/config/app-sre/infra/app-sre-infra-main.yaml index b4ab29f4375a..d22c23594580 100644 --- a/ci-operator/config/app-sre/infra/app-sre-infra-main.yaml +++ b/ci-operator/config/app-sre/infra/app-sre-infra-main.yaml @@ -2,6 +2,7 @@ build_root: project_image: dockerfile_path: ci/build-root/Dockerfile prowgen: + disable_sparse_checkout: true enable_secrets_store_csi_driver: true expose: true private: true @@ -15,6 +16,125 @@ tests: commands: make lint container: from: src +- as: validate + run_if_changed: ^(terraform|hcp-terraform)/ + steps: + test: + - as: validate + commands: | + git config --global url."https://github.com/".insteadOf "git@github.com:" + git config --global credential.helper '!f() { + if [ "$1" = "get" ]; then + host="" proto="" + while IFS= read -r line; do + [ -z "$line" ] && break + case "$line" in + host=*) host="${line#host=}" ;; + protocol=*) proto="${line#protocol=}" ;; + esac + done + if [ "$proto" = "https" ] && [ "$host" = "github.com" ]; then + echo "username=x-access-token" + echo "password=$(cat /etc/github-private/oauth)" + else + exit 1 + fi + fi + }; f' + umask 077 + cat > "$HOME/.terraformrc" < "$HOME/.terraformrc" <