Either do something like fetch-depth: ${{github.event.push.commits}} that doesn't break for the pull_request event and others.
Possibly: fetch-depth: ${{github.event.push.commits || github.event.pull_request.commits}} if that works.
And for the pull_request event I guess I could run git fetch origin ${{github.event.pull_request.base.ref}} in the action itself.
Or even git fetch --shallow-exclude=base/${{github.event.pull_request.base.ref}}^
Either do something like
fetch-depth: ${{github.event.push.commits}}that doesn't break for the pull_request event and others.Possibly:
fetch-depth: ${{github.event.push.commits || github.event.pull_request.commits}}if that works.And for the pull_request event I guess I could run
git fetch origin ${{github.event.pull_request.base.ref}}in the action itself.Or even
git fetch --shallow-exclude=base/${{github.event.pull_request.base.ref}}^