@@ -16,6 +16,7 @@ import {Spinner} from '../../utils/spinner.js';
16
16
import { AuthenticatedGitClient } from '../../utils/git/authenticated-git-client.js' ;
17
17
import { addGithubTokenOption } from '../../utils/git/github-yargs.js' ;
18
18
import { getYarnPathFromNpmGlobalBinaries } from '../../utils/resolve-yarn-bin.js' ;
19
+ import { getRepositoryGitUrl } from '../../utils/git/github-urls.js' ;
19
20
20
21
async function builder ( argv : Argv ) {
21
22
return addGithubTokenOption ( argv ) ;
@@ -91,15 +92,23 @@ async function handler() {
91
92
const commitMessage = `${ title } \n\n${ body } ` ;
92
93
/** The name of the branch to use on remote. */
93
94
const branchName = `yarn-update-v${ newYarnVersion } ` ;
95
+ /** The fork of the user */
96
+ const userFork = await git . getForkOfAuthenticatedUser ( ) ;
94
97
/** The name of the owner for remote branch on Github. */
95
- const { owner : localOwner } = await git . getForkOfAuthenticatedUser ( ) ;
98
+ const { owner : localOwner } = userFork ;
96
99
97
100
spinner . update ( 'Staging yarn vendoring files and creating commit' ) ;
98
101
git . run ( [ 'add' , '.yarn/releases/**' , '.yarnrc' ] ) ;
99
102
git . run ( [ 'commit' , '-q' , '--no-verify' , '-m' , commitMessage ] , { env : skipHuskyEnv } ) ;
100
103
101
104
spinner . update ( 'Pushing commit changes to github.' ) ;
102
- git . run ( [ 'push' , '-q' , 'origin' , '--force-with-lease' , `HEAD:refs/heads/${ branchName } ` ] ) ;
105
+ git . run ( [
106
+ 'push' ,
107
+ '-q' ,
108
+ getRepositoryGitUrl ( userFork , git . githubToken ) ,
109
+ '--force-with-lease' ,
110
+ `HEAD:refs/heads/${ branchName } ` ,
111
+ ] ) ;
103
112
104
113
spinner . update ( 'Creating a PR for the changes.' ) ;
105
114
const { number} = (
0 commit comments