-
Notifications
You must be signed in to change notification settings - Fork 33
find PRs from forks #328
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
find PRs from forks #328
Conversation
|
Not sure what I've done wrong since the failing log is empty for me. |
| const commit_sha = triggeredFromPR | ||
| ? github.context.payload.pull_request?.head.sha | ||
| : sha |
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.
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.
Actually, I just noticed that this is incorrect since it overrides the user input in sha.
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.
What prevents us from just kicking the const commit_sha out of here and using always the sha from the function argument?
Then we don't need to base this on the #329 at all, since all you need is use the current workaround, for providing the sha per config manually, but the rest (owner and repo) will be working for forked and not-forked PRs?
Or what am I overlooking?
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.
Ah, that's what I had in 9a8fcfc, but it was failing CI since the "build / clean-run (pull_request)" job doesn't pass on the correct sha. I guess if you prefer, I can re-open this and also add the workaround to the CI job? It just seemed simpler to go with #329 first (e.g. would you want to revert the CI change after that's merged?), but either way works for me.
edit: I've gone ahead and done the above.
|
Per the above comments, I don't see a clean way to implement this without #329, so I'm going to close this and then rebase / reopen after that is merged. |
Proposed changes
This change will allow the action to properly find the PR when it is triggered via
pull_requestorpull_request_targetfrom a PR from a fork, by calling the API endpoint corresponding to the repo at the head of the PR, rather than the base repo.Fixes #326.
Types of changes
What types of changes does your code introduce ?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...