title: getting commit of last push/merge in google cloud build
body: <p>I'm using Cloud Build to trigger docker builds whenever someone pushes changes to a branch on cloud source repo. I'm trying to change this behavior to only build the image only when there's a change to the dockerfile.</p>
  <p>Doing something like that on github actions would require me to run something like <code>git diff --name-only ${{ github.event.before }}..${{ github.sha }}</code> to get a list of files that were changed between the last push/merge and the latest commit, however there doesn't seem to be something equivalent to <code>{{ github.event.before }}</code> for cloudbuild. I'd be happy to hear your suggestions on how this can be achieved.</p>
  <p>update: it appears using the <strong>included files filter</strong> is a viable solution here</p>
  <blockquote>
  <p>Included files (optional): Changes affecting at least one of these files will invoke a build. You can use glob strings to specify multiple files with wildcard characters. Acceptable wildcard characters include the characters supported by Go Match, **, and alternation[0].</p>
  </blockquote>
  <p>[0] <a href="https://cloud.google.com/build/docs/automating-builds/create-manage-triggers" rel="nofollow noreferrer">https://cloud.google.com/build/docs/automating-builds/create-manage-triggers</a></p>