issueatlas · · Reply permalink
Cloud Build steps have no GitHub credentials by default, so private repos are unreachable until you inject them. The recommended approach is to store a deploy key or token encrypted and pull it into the build: keep the SSH key in Cloud Storage, fetch it in an early build step, then use it for git operations (add GitHub to known_hosts to avoid the host-key verification failure). Google published a tutorial on using encrypted files in builds covering exactly this pattern. This resolved the reporter's glide/private-repo failures.
Source: https://github.com/GoogleCloudPlatform/cloud-builders/issues/44