File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -415,6 +415,7 @@ func TestConfigureTLSTrustEnvironment(t *testing.T) {
415415
416416 t .Run ("sets trust environment variables in process" , func (t * testing.T ) {
417417 assert := assert .New (t )
418+ t .Setenv ("GITHUB_ENV" , "" )
418419 for _ , key := range tlsTrustEnvKeys {
419420 t .Setenv (key , "" )
420421 }
@@ -428,8 +429,17 @@ func TestConfigureTLSTrustEnvironment(t *testing.T) {
428429 })
429430
430431 t .Run ("does not rely on GITHUB_ENV" , func (t * testing.T ) {
431- t .Setenv ("GITHUB_ENV" , "/path/that/does/not/exist/github_env" )
432+ assert := assert .New (t )
433+ githubEnvFile := t .TempDir () + "/github_env"
434+ const original = "UNCHANGED=1\n "
435+ require .NoError (t , os .WriteFile (githubEnvFile , []byte (original ), 0o644 ))
436+ t .Setenv ("GITHUB_ENV" , githubEnvFile )
437+
432438 require .NoError (t , configureTLSTrustEnvironment (caPath ))
439+
440+ content , err := os .ReadFile (githubEnvFile )
441+ require .NoError (t , err )
442+ assert .Equal (original , string (content ))
433443 })
434444
435445 t .Run ("rejects CA cert path with newline" , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments