@@ -30,17 +30,17 @@ function git(args: string[], cwd: string) {
3030function remoteHasRef (
3131 remoteUrl : string ,
3232 ref : string ,
33- token : string | undefined ,
33+ // token: string | undefined,
3434) : boolean {
3535 try {
36- const args = [ "ls-remote" , "--heads" ] ;
37- if ( token ) {
38- args . push (
39- "-c ",
40- `http.extraHeader=Authorization: Bearer ${ token } ` ,
41- ) ;
42- }
43- args . push ( remoteUrl , ref ) ;
36+ const args : string [ ] = [
37+ "-c" ,
38+ "http.https://github.com/.extraheader=" ,
39+ "ls-remote ",
40+ "--heads" ,
41+ remoteUrl ,
42+ ref ,
43+ ] ;
4444 const out = execFileSync ( "git" , args , {
4545 stdio : [ "ignore" , "pipe" , "pipe" ] ,
4646 } )
@@ -55,8 +55,9 @@ function remoteHasRef(
5555
5656function buildRemoteUrl ( repo : string , token : string | undefined ) : string {
5757 if ( token ) {
58- return `https://x-access-token: ${ token } @github.com/${ repo } .git` ;
58+ return `https://${ token } @github.com/${ repo } .git` ;
5959 }
60+
6061 return `git@github.com:${ repo } .git` ;
6162}
6263
@@ -90,7 +91,7 @@ export async function fetchSnapshots(): Promise<void> {
9091 let ref = requestedRef ;
9192 if (
9293 requestedRef !== DEFAULT_REF &&
93- ! remoteHasRef ( remoteUrl , requestedRef , token )
94+ ! remoteHasRef ( remoteUrl , requestedRef )
9495 ) {
9596 console . log (
9697 `Snapshot branch '${ requestedRef } ' not found on ${ repo } ; falling back to '${ DEFAULT_REF } '.` ,
@@ -117,6 +118,8 @@ export async function fetchSnapshots(): Promise<void> {
117118 execFileSync (
118119 "git" ,
119120 [
121+ "-c" ,
122+ "http.https://github.com/.extraheader=" ,
120123 "clone" ,
121124 "--depth" ,
122125 "1" ,
0 commit comments