@@ -815,7 +815,8 @@ async function convertOutputMode({
815815 const downloadSnippets = generator . snippets != null && generator . snippets . path !== "" ;
816816 if ( generator . github ) {
817817 const repoString = isGithubSelfhosted ( generator . github ) ? generator . github . uri : generator . github . repository ;
818- const { owner, repo } = parseRepository ( repoString ) ;
818+ const { owner, repo, remote } = parseRepository ( repoString ) ;
819+ const host = remote !== "github.com" ? remote : undefined ;
819820 const publishInfo =
820821 generator . output != null
821822 ? getGithubPublishInfo ( generator . output , maybeGroupLevelMetadata , maybeTopLevelMetadata )
@@ -833,15 +834,17 @@ async function convertOutputMode({
833834 case "commit" :
834835 case "release" : {
835836 const releaseConfig = generator . github as generatorsYml . GithubCommitAndReleaseSchema ;
837+ const commitAndReleaseValue = {
838+ owner,
839+ repo,
840+ host,
841+ branch : releaseConfig . branch ,
842+ license,
843+ publishInfo,
844+ downloadSnippets
845+ } ;
836846 return FernFiddle . OutputMode . githubV2 (
837- FernFiddle . GithubOutputModeV2 . commitAndRelease ( {
838- owner,
839- repo,
840- branch : releaseConfig . branch ,
841- license,
842- publishInfo,
843- downloadSnippets
844- } )
847+ FernFiddle . GithubOutputModeV2 . commitAndRelease ( commitAndReleaseValue )
845848 ) ;
846849 }
847850 case "pull-request" : {
@@ -851,29 +854,30 @@ async function convertOutputMode({
851854 groupLevelReviewers : maybeGroupLevelReviewers ,
852855 outputModeReviewers : pullRequestConfig . reviewers
853856 } ) ;
854- return FernFiddle . OutputMode . githubV2 (
855- FernFiddle . GithubOutputModeV2 . pullRequest ( {
856- owner,
857- repo,
858- license,
859- publishInfo,
860- downloadSnippets,
861- reviewers,
862- branch : pullRequestConfig . branch
863- } )
864- ) ;
857+ const pullRequestValue = {
858+ owner,
859+ repo,
860+ host,
861+ license,
862+ publishInfo,
863+ downloadSnippets,
864+ reviewers,
865+ branch : pullRequestConfig . branch
866+ } ;
867+ return FernFiddle . OutputMode . githubV2 ( FernFiddle . GithubOutputModeV2 . pullRequest ( pullRequestValue ) ) ;
868+ }
869+ case "push" : {
870+ const pushValue = {
871+ owner,
872+ repo,
873+ host,
874+ branch : generator . github . mode === "push" ? generator . github . branch : undefined ,
875+ license,
876+ publishInfo,
877+ downloadSnippets
878+ } ;
879+ return FernFiddle . OutputMode . githubV2 ( FernFiddle . GithubOutputModeV2 . push ( pushValue ) ) ;
865880 }
866- case "push" :
867- return FernFiddle . OutputMode . githubV2 (
868- FernFiddle . GithubOutputModeV2 . push ( {
869- owner,
870- repo,
871- branch : generator . github . mode === "push" ? generator . github . branch : undefined ,
872- license,
873- publishInfo,
874- downloadSnippets
875- } )
876- ) ;
877881 default :
878882 assertNever ( mode ) ;
879883 }
0 commit comments