title: Is it possible to call Google Cloud Build via API with cloudbuild.yaml in source repo
body: <p>I have an Cloud Build trigger that is set up to fetch a specific branch from a remote repository and use the <code>cloudbuild .yaml</code> file from it to run the build. I need to do the same programatically via an API call and the only way I can see this happening is with an API call here: <a href="https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds/create" rel="nofollow noreferrer">https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds/create</a>. </p>
  
  <p>By looking at the required request body which is of type <code>Build</code> <a href="https://cloud.google.com/cloud-build/docs/api/reference/rest/Shared.Types/Build" rel="nofollow noreferrer">https://cloud.google.com/cloud-build/docs/api/reference/rest/Shared.Types/Build</a> it seems that while I can provide the source repository (branch, commit or tag) I'm not sure how to provide the path to <code>cloudbuild.yaml</code> which in this case really needs to sit with the repo source code. Also it seems a <code>steps</code> param is required which actually has to be the steps from the cloudbuild file.</p>
  
  <p>Is there any way that I can create a build using the same resources that I would otherwise set up in a cloud trigger (path to (<code>cloudbuild.yaml</code> instead of the steps to which I don't have access to in this case)?</p>