<p>I'm trying to build and deploy an image on GCP with cloud build.
I have a rails api repo on bitbucket running on docker, the repo is synced with google cloud repository</p>
<p>I configured a trigger on cloud build when a commit is made on my master branch.</p>
<p>Trigger Configuration:</p>
<p><a href="https://i.stack.imgur.com/XKPTe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XKPTe.png" alt="Trigger Configuration" /></a></p>
<p>Service account permissions:</p>
<p><a href="https://i.stack.imgur.com/gooYM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gooYM.png" alt="Service account permissions" /></a></p>
<p>But when the master branch gets a commit, the triggers returns the following error:
<code>our build failed to run: &lt;br&gt;Couldn't read commit xxxxxxxx</code></p>
<p>Build Error:</p>
<p><a href="https://i.stack.imgur.com/irmbk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/irmbk.png" alt="Build Error" /></a></p>
<p>I tried checked the GCP doc and I can't find anything. I think the issue might be on the IAM level, maybe the service account needs more credentials.</p>

Hugues
<p>For me the Cloud Build API needed to be enabled.  Once I did this my build ran, I didn't need to do anything special for permissions.</p>
