File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { execSync } from "child_process" ;
12import Z from "zod" ;
23
34const defaultMessage = "feat: update translations via @lingodotdev" ;
@@ -23,7 +24,13 @@ export abstract class PlatformKit<PlatformConfig extends BasePlatformConfig = Ba
2324
2425 abstract buildPullRequestUrl ( pullRequestNumber : number ) : string ;
2526
26- gitConfig ( ) : Promise < void > | void { }
27+ gitConfig ( token ?: string , repoUrl ?: string ) {
28+ if ( token && repoUrl ) {
29+ execSync ( `git remote set-url origin ${ repoUrl } ` , {
30+ stdio : "inherit" ,
31+ } ) ;
32+ }
33+ }
2734
2835 get config ( ) {
2936 const env = Z . object ( {
Original file line number Diff line number Diff line change @@ -79,9 +79,7 @@ export class GitHubPlatformKit extends PlatformKit {
7979
8080 const url = `https://${ ghToken } @github.com/${ repositoryOwner } /${ repositoryName } .git` ;
8181
82- execSync ( `git remote set-url origin ${ url } ` , {
83- stdio : "inherit" ,
84- } ) ;
82+ super . gitConfig ( ghToken , url ) ;
8583 }
8684 }
8785
Original file line number Diff line number Diff line change @@ -91,11 +91,10 @@ export class GitlabPlatformKit extends PlatformKit {
9191 }
9292
9393 gitConfig ( ) : Promise < void > | void {
94- const url = `https://oauth2:${ this . platformConfig . glToken } @gitlab.com/${ this . platformConfig . repositoryOwner } /${ this . platformConfig . repositoryName } .git` ;
94+ const glToken = this . platformConfig . glToken ;
95+ const url = `https://oauth2:${ glToken } @gitlab.com/${ this . platformConfig . repositoryOwner } /${ this . platformConfig . repositoryName } .git` ;
9596
96- execSync ( `git remote set-url origin ${ url } ` , {
97- stdio : "inherit" ,
98- } ) ;
97+ super . gitConfig ( glToken , url ) ;
9998 }
10099
101100 buildPullRequestUrl ( pullRequestNumber : number ) : string {
You can’t perform that action at this time.
0 commit comments