diff --git a/.changeset/violet-kids-clean.md b/.changeset/violet-kids-clean.md new file mode 100644 index 0000000000..d1b95bf9cf --- /dev/null +++ b/.changeset/violet-kids-clean.md @@ -0,0 +1,5 @@ +--- +"@pnpm/git-resolver": patch +--- + +Resolve commits from GitHub via https. diff --git a/packages/git-resolver/src/parsePref.ts b/packages/git-resolver/src/parsePref.ts index 19dfc13066..705b64cd8c 100644 --- a/packages/git-resolver/src/parsePref.ts +++ b/packages/git-resolver/src/parsePref.ts @@ -77,10 +77,7 @@ function urlToFetchSpec (urlparse: URL) { async function fromHostedGit (hosted: any): Promise { // eslint-disable-line let fetchSpec: string | null = null // try git/https url before fallback to ssh url - - // Note only GitHub has gitTemplate (git://...) in hosted-git-info, has to use - // sshTemplate (git@...) for bitbucket and gitlab. - const gitUrl = hosted.git({ noCommittish: true }) ?? hosted.ssh({ noCommittish: true }) + const gitUrl = hosted.https({ noCommittish: true }) ?? hosted.ssh({ noCommittish: true }) if (gitUrl && await accessRepository(gitUrl)) { fetchSpec = gitUrl }