-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Feature/Bug] Forked PR support #26
Comments
Hello, thank you for bringing this up. Is the 'fork-pr' a PR opened from a fork to merge a fork branch into the upstream repository? I'm not sure how to reproduce this. Is it possible to post the fork-pr here? So we can look into the scenario and the workflow file. |
Yes |
Reference: As the workflow file is quite big here a line link: https://github.com/nbrugger-tgm/java-spring-template/actions/runs/1449676603/workflow#L68 |
Thank you for the details! The culprit seems to be the Because And there seems to be a workaround for the issue, if the user really want to accept the risk. I've tested the workaround, adding a Is there any other change you would like to add? Or maybe we can just add a document for the workaround of this case? |
Since your action does not uses any file from the checked out source there should not be a security risk involved (except you check out the head source and leave it like this). I dont know exactly how you build the diff but i think you could fall back to Is this approach feasable? |
I would not do this as it encourages the user to introduce security vulnerabilities |
Yes, the action only "unshallow" the repository and won't modify the worktree. (Unshallow might be inefficient for large repositroies...but I haven't figured out a way to just fetch a few commits we need to calculate the diff)
For I think this approach is doable but I'm not sure if simply fallback to For the fork-pr scenario, "unshallow" alone won't get all the commits required to calculate the diff because the "head" or "target" commit is in another repository, the fork repository. We will need to fetch the head commit by the Also, we need to be careful not to checkout the
Indeed, for figuring out the diff, we don't need to checkout the external commit. If the above approach is possible, then we don't need to compromise. |
I think I know a possible solution. If you use commit sha for the git diff you could use |
When using this action on a fork-pr it breaks and fails the step.
Log
head is the fork origin (
00d1b3fef04e6191889f4dcf17173c7f1c46ff28
)If it is ok i would pick up on this issue and contribute if you can confirm that it is a bug and not just misuse. Also testing this would be done by me by adding a new
pull_request
(withouttarget
) workflow that just logs the resultThe text was updated successfully, but these errors were encountered: