-
-
Notifications
You must be signed in to change notification settings - Fork 4
fix: checkout pull request head ref #24
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
base: main
Are you sure you want to change the base?
fix: checkout pull request head ref #24
Conversation
I'll test if this pull request resolves the issue. |
…t.pull_request.head.ref
9bc18a6
to
a148ca7
Compare
It looks fine. |
index.ts
Outdated
@@ -55,7 +55,7 @@ async function main() { | |||
await exec("git", ["show", commit_hash]); | |||
} | |||
// Fetch and check out PR head | |||
await exec("git", ["fetch", "--depth=1", "origin", `+refs/pull/${event.pull_request.number}/head`]); | |||
await exec("git", ["fetch", "--depth=1", "origin", event.pull_request.head.ref]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that probably this doesn't work in case of pull requests from fork repositories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
989fe99 Checkout event.pull_request.head.sha
instead of event.pull_request.head.ref
.
https://github.com/actions/checkout?tab=readme-ov-file#Checkout-pull-request-HEAD-commit-instead-of-merge-commit
Close #23