-
Notifications
You must be signed in to change notification settings - Fork 129
Conversation
Thanks for the PR and the detailed analysis. Maybe we don't need to worry about forks? Users can checkout different repos using |
The scenario I'm thinking of is when the workflow does NOT have push credentials to upstream repo. If I want to make a PR to a repo that I don't have write access to, I first need to fork it, and then push a branch to that fork. Then I can create a PR. |
Workflow imo is something you want to keep rerunning. One-off tasks like creating the fork can be delegated to one-time manual creation or to a different action / script. Pushing changes can also be delegated to another action. This leaves |
6788cfb
to
e9d359c
Compare
Hi @wei (I'm Wei too!) and @rabernat (small world 😆). I'm quite interested in this too for conda-forge/gmt-feedstock#100, specifically the Pull Request creation from a fork (that's already created) to an upstream repository. Assuming that a fork is already present, does that mean this PR would work, or is there something else that is missing/more work to do? |
@weiji14 Hi Wei!!! I tried it with hub commandline but it doesn't seem to work with forks so closing this PR for now. After cli/cli#1478 is fixed, you could do something like this:
|
@weiji14 Updated the snippet above, you can run |
Excellent, thanks for the quick follow up! I see too that there are more configuration options documented at https://cli.github.com/manual/gh_pr_create. Quick question: Is the |
@weiji14 I haven't tried GITHUB_TOKEN but I doubt it will work. Feel free to try it and let us know. 😃😃😃 |
Yep,
A quick search turns up actions/first-interaction#10, actions/labeler#50 and https://github.community/t/github-actions-are-severely-limited-on-prs/18179/2. According to https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token, the
So |
This is my attempt to fix #18. My goal is to be able to make a PR to a different repo than $GITHUB_REPOSITORY, the repo running the action. I realized this is a bit more complicated, because we can't assume that the branches are both on the same repo. Furthermore, we can't assume the source branch even exists I think we need to:
I can't figure out how to do the last two.
I realize this may add significant complexity that you don't want. But I thought I would share what I have so far.