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
Ask user to select PR templates when forking a repository #143733
Conversation
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Co-authored-by: João Moreno <mail@joaomoreno.com>
Co-authored-by: João Moreno <mail@joaomoreno.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Besides this PR's main focus, there's one other thing that I don't quite get it. Here's the typical scenario that happens: when the Publish to Github command is triggered, which is the only command registered by the extension, it always creates a new repository (here) for the user and then pushes files to it. If the push fails, then Now, my question is, why do we try to fork the repository? We've already created the repository itself. To me, this seems like a general way of handling push errors, so I checked for any other usage for the To verify my point just check the |
Yes, if you clone a repository for which you have no permissions to push, this error handler comes in handy and prompts you to fork the repository. Catching a push error is more about that scenario than the |
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.
It's very cool that you've added tests... even though they feel a bit overkill.
I've merged main
and cleaned the implementation a bit, so we don't create functions all the time. Doing that, I found an issue. On case insensitive systems (ie Windows), a pull_request_template.md
file will appear twice: once as pull_request_template.md
, and once as PULL_REQUEST_TEMPLATE.md
. It would be best to rely on fs.readDirectory
on all detection; that way we'd always get what the OS has, instead of assuming file name casing.
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Yes. I had missed the case sensitivity point too. I've updated the code and replaced |
Speaking of case sensitivity, the new |
Yes, best to remove one of them. |
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Done. I've deleted lowercase counterparts. |
Thanks! 🍻 |
This PR fixes #143083