Strip optional '.git' suffix from https server remote name.#1153
Strip optional '.git' suffix from https server remote name.#1153peter-evans merged 3 commits intopeter-evans:mainfrom
Conversation
|
Hi @salexander6 Thank you for identifying this issue. I'm interested to know how this occurs so I can reproduce it. Please could you show me a workflow that results in this happening. Perhaps you are not using the official |
src/utils.ts
Outdated
| remoteUrl = remoteUrl.replace(/\.git$/, '') | ||
|
|
||
| const httpsUrlPattern = new RegExp( | ||
| '^https?://.*@?' + githubServerMatch[1] + '/(.+/.+)$', |
There was a problem hiding this comment.
I would prefer to fix this by only changing the regex.
'^https?://.*@?' + githubServerMatch[1] + '/(.+/.+?)(.git)?$',Also, please add a test for this pattern here:
https://github.com/peter-evans/create-pull-request/blob/main/__test__/utils.unit.test.ts#L35-L53
There was a problem hiding this comment.
I would prefer to fix this by only changing the regex.
👍
The repo is private but here's the relevant workflow section Adding this here has me wondering if cloning without the |
This reverts commit c2e9041.
|
Ok, it makes sense now. Not using the official checkout action causes the remote URL to include the |
|
/test repository=99spokes/create-pull-request ref=fix-https-repository-name build=true |
|
Thank you! Released as |
|
Thanks for the great action! |
…er-evans#1153) * Strip optional '.git' suffix from https server remote name. * Revert "Strip optional '.git' suffix from https server remote name." This reverts commit c2e9041. * Strip optional '.git' suffix from https server remote name.
Fixes an error when creating a PR, similar to what is described here #1096
My repository name was identified as
data.gitand the.gitsuffix caused an error when creating the PR here https://github.com/peter-evans/create-pull-request/blob/main/src/github-helper.ts#L47