@@ -8,6 +8,7 @@ const toolDir = path.join(__dirname, "runner", "tools");
8
8
const tempDir = path . join ( __dirname , "runner" , "temp" ) ;
9
9
const dataDir = path . join ( __dirname , "testdata" ) ;
10
10
const IS_WINDOWS = process . platform === "win32" ;
11
+ const GITHUB_TOKEN = process . env . GITHUB_TOKEN || "" ;
11
12
12
13
process . env [ "RUNNER_TEMP" ] = tempDir ;
13
14
process . env [ "RUNNER_TOOL_CACHE" ] = toolDir ;
@@ -31,7 +32,7 @@ describe("installer tests", () => {
31
32
} ) ;
32
33
33
34
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 ) ;
35
36
const protocDir = path . join ( toolDir , "protoc" , "3.9.0" , os . arch ( ) ) ;
36
37
37
38
expect ( fs . existsSync ( `${ protocDir } .complete` ) ) . toBe ( true ) ;
@@ -58,7 +59,7 @@ describe("installer tests", () => {
58
59
} ) ;
59
60
60
61
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 ) ;
62
63
const protocDir = path . join ( toolDir , "protoc" , "3.7.1" , os . arch ( ) ) ;
63
64
64
65
expect ( fs . existsSync ( `${ protocDir } .complete` ) ) . toBe ( true ) ;
@@ -72,7 +73,7 @@ describe("installer tests", () => {
72
73
} , 100000 ) ;
73
74
74
75
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 ) ;
76
77
const protocDir = path . join ( toolDir , "protoc" , "3.9.1" , os . arch ( ) ) ;
77
78
78
79
expect ( fs . existsSync ( `${ protocDir } .complete` ) ) . toBe ( true ) ;
0 commit comments