@@ -8,6 +8,7 @@ const toolDir = path.join(__dirname, "runner", "tools");
88const tempDir = path . join ( __dirname , "runner" , "temp" ) ;
99const dataDir = path . join ( __dirname , "testdata" ) ;
1010const IS_WINDOWS = process . platform === "win32" ;
11+ const GITHUB_TOKEN = process . env . GITHUB_TOKEN || "" ;
1112
1213process . env [ "RUNNER_TEMP" ] = tempDir ;
1314process . env [ "RUNNER_TOOL_CACHE" ] = toolDir ;
@@ -31,7 +32,7 @@ describe("installer tests", () => {
3132 } ) ;
3233
3334 it ( "Downloads version of protoc if no matching version is installed" , async ( ) => {
34- await installer . getProtoc ( "3.9.0" , true , process . env [ " GITHUB_TOKEN" ] ) ;
35+ await installer . getProtoc ( "3.9.0" , true , GITHUB_TOKEN ) ;
3536 const protocDir = path . join ( toolDir , "protoc" , "3.9.0" , os . arch ( ) ) ;
3637
3738 expect ( fs . existsSync ( `${ protocDir } .complete` ) ) . toBe ( true ) ;
@@ -58,7 +59,7 @@ describe("installer tests", () => {
5859 } ) ;
5960
6061 it ( "Gets the latest 3.7.x version of protoc using 3.7 and no matching version is installed" , async ( ) => {
61- await installer . getProtoc ( "3.7" , true , process . env [ " GITHUB_TOKEN" ] ) ;
62+ await installer . getProtoc ( "3.7" , true , GITHUB_TOKEN ) ;
6263 const protocDir = path . join ( toolDir , "protoc" , "3.7.1" , os . arch ( ) ) ;
6364
6465 expect ( fs . existsSync ( `${ protocDir } .complete` ) ) . toBe ( true ) ;
@@ -72,7 +73,7 @@ describe("installer tests", () => {
7273 } , 100000 ) ;
7374
7475 it ( "Gets latest version of protoc using 3.x and no matching version is installed" , async ( ) => {
75- await installer . getProtoc ( "3.x" , true , process . env [ " GITHUB_TOKEN" ] ) ;
76+ await installer . getProtoc ( "3.x" , true , GITHUB_TOKEN ) ;
7677 const protocDir = path . join ( toolDir , "protoc" , "3.9.1" , os . arch ( ) ) ;
7778
7879 expect ( fs . existsSync ( `${ protocDir } .complete` ) ) . toBe ( true ) ;
0 commit comments