[CI] Improve fetching of changed files
PRs always use a merge into the repo on checkout, so checking for
`HEAD^1` will show all the changes regardless of the number of commits
in a PR
(cherry picked from commit 950743c3d87275a65a99fd9dffc9250669eefec1)