-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use parent specifiers in the ref #61
Comments
@mathstuf consider adding a |
But is that going to mean that |
Yes. GITHUB_SHA is not set by the checkout action. It is from the server event payload. |
And while that may be a workaround, not being able to specify a valid Git refname in such a way (and that gets silently ignored) seems like a bug in any case. |
Also of note is that manual checkout misses all of the submodule sync/update, depth options, etc. available through the action. |
from the pr event payload, i think |
I think this will checkout the merging branch instead of the merge commit.
Edit: I misunderstood. I think this only works for non-fork PRs. |
@peter-evans instead of refs/pull/merge/<number> iirc refs/pull/<number> contains the commit (for forks and non forks). i may be wrong? |
@ericsciple I tested the following but it didn't work and gave the error
What does seem to work for me is the following. But to make this work for forks as well you need to use a
|
i'll play with this a bit, i think there's a different way |
@peter-evans sorry its i played around with this locally by fetching everything under pull:
|
@mathstuf it sounds like the following solution will work:
|
Thanks, I'll try that out when I get a chance. However, I feel like that shouldn't be necessary and that |
I'll update the README with the scenario: checkout the head commit of a PR, rather than the merge commit. Leaving this issue open and i'll mark it as enhancement. Also interested in other scenarios. |
@ericsciple first of all, thanks a lot for your replies on this thread. It helped me a lot to configure my action. In the README update you have used To handle the checkout of head commit during PR creation as well as synchronize either:
can be used. I have created a PR with the second option to update the README as that felt better to read and explained exactly as the title read. |
@mrrobot47 thanks. also note, the first option is a race condition because the PR can be updated before the job starts (ref update) |
FWIW, the way GitLab-CI seems to get around that is that CI jobs pull a |
Test commit_message with ref Update code-style.yml Experimenting see actions/checkout#61 (comment) Experimenting 2 Experimenting 3 Try `pull_request_target` Fix code style Revert "Fix code style" This reverts commit 2ecc65b. Remove other tasks
Test commit_message with ref Update code-style.yml Experimenting see actions/checkout#61 (comment) Experimenting 2 Experimenting 3 Try `pull_request_target` Fix code style Revert "Fix code style" This reverts commit 2ecc65b. Remove other tasks
I'd like to run an action on a pull_request and check out the actual content of the PR, not a merge with
master
(because I want it to run even if there is a merge conflict among other reasons). Support for specifying this has been requested on the community forum.I've tried the following:
Which causes a failure because it tries to do:
which is an invalid refspec.
Doing this seems to just get completely ignored:
I haven't found a way to use
$GITHUB_SHA
yet either (it seems to be used literally when in awith
block).The text was updated successfully, but these errors were encountered: