Open Kurt-von-Laven opened 2 years ago
co-signed. We're running into this with a rake task of ours:
git diff --exit-code origin/HEAD -- /home/runner/work/depot/depot/db/vtiger_structure.sql
fatal: bad revision 'origin/HEAD'
And to be clear, this is with a "full history" checkout:
steps:
- uses: actions/checkout@v3
with: {fetch-depth: 0} # need history for git-diffing
Bump on this.
Was hoping to use the origin/${{github.base_ref || 'HEAD^'}}
in a workflow that could be run on PR or push events; but origin/HEAD
is still not present after checkout.
origin/HEAD
is a useful ref since it refers to the default branch, which varies between repos.origin/HEAD
is normally present locally, so Git scripts, hooks, etc. that work locally sometimes rely on the presence oforigin/HEAD
and then break in GitHub Actions. I'm not aware of an input that allows one to ensure that this useful ref is present in a checkout. As a workaround, we rungit remote set-head origin --auto
manually, but it would be nice to have within the action since diagnosing the issue requires considerable familiarity with Git. In particular, I find the absence oforigin/HEAD
when passingfetch-depth: 0
counterintuitive.