chanzuckerberg / github-actions

A collection of re-usable GitHub Actions
MIT License
5 stars 3 forks source link

fix: add fallback to force push detection #301

Closed hspitzley-czi closed 2 months ago

hspitzley-czi commented 2 months ago

Triggering this on pull_request can cause complications for a handful of reasons. Primarily:

If the file change detection looks at the whole PR to decide whether a file changed that requires rebuild, it will lead to a build cycle because each commit will retrigger and it will see all the files that changed and build again (this is what we saw start to happen in your PR)

If the file change detection looks at only the most recent commit and the stack label is added to the PR when the most recent commit doesn’t include a chance to a file that would require building the image, it won’t build and I think this will be an confusing user experience

There are also complications with getting the correct commit sha