softprops / diffset

A GitHub Action for producing lists of files that changed between branches
MIT License
9 stars 3 forks source link

diffset not including diff of files when merged to master #7

Closed softprops closed 3 years ago

softprops commented 3 years ago

diffset current replies on GITHUB_REF and an assume but configurable base, currently "master".

This works well enough for typically diffsets in pushes to pr branches but not at all for merges to master. The reason bying that the GITHUB_REF always represents the ref that triggered to pull request which is in the case of a merge to master, a push to master so comparing master to master will always yield an empty set.

how ever we can leverage another bit of information. GITHUB_SHA refers to the direct commit that commit pushed which in the case of a merge is the sha of the merge. we can't exactly use the same comparison api for compare/sha...master because they would also yield an empty sets.

instead we can detect the case of a ref being the same as a base and use an an alternative strategy for fetching a list of files involved in the GITHUB_SHA