actions/checkout fails with:
ref: ${{ github.event.pull_request.head.sha }}
with un-pushed commits
#2391
Unanswered
brianjmurrell
asked this question in
Q&A
Replies: 1 comment
-
This was the work-around I used to overcome this: - uses: actions/checkout@v4
if: ${{!env.ACT}}
with:
ref: branch/name
- uses: actions/checkout@v4
if: env.ACT
- run: git fetch origin
if: env.ACT
- run: git checkout --force branch/name
if: env.ACT |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If I have a step:
When I have local commits that I have not pushed remotely, the checkout action fails since
github.event.pull_request.head.sha
doesn't exist on GitHub yet, as I have not pushed it.How do I simulate a checkout on the code that is only in my local repo? I.e. that I have not yet pushed.
Surely I don't have to push my local commits. The entire point of using
act
is to test my code locally before pushing it.Reference: https://github.com/actions/checkout/blob/v3.0.2/README.md#checkout-pull-request-head-commit-instead-of-merge-commit
Beta Was this translation helpful? Give feedback.
All reactions