Skip to content

Commit f274154

Browse files
Copilotlpcox
andauthored
Use explicit octal perms and document best-effort GITHUB_ENV append
Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/3bd624f8-e072-4062-b1f9-22dde46c5b34 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent 11cf12a commit f274154

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

internal/cmd/proxy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ func configureTLSTrustEnvironment(caCertPath string) error {
334334
return nil
335335
}
336336

337-
f, err := os.OpenFile(githubEnvPath, os.O_APPEND|os.O_WRONLY, 0644)
337+
// Best-effort append: the proxy should still start even if GITHUB_ENV cannot be opened.
338+
f, err := os.OpenFile(githubEnvPath, os.O_APPEND|os.O_WRONLY, 0o644)
338339
if err != nil {
339340
logger.LogWarn("startup", "Skipping GITHUB_ENV TLS trust export: open failed for %s: %v", githubEnvPath, err)
340341
return nil

internal/cmd/proxy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ func TestConfigureTLSTrustEnvironment(t *testing.T) {
436436
t.Run("appends trust environment variables to GITHUB_ENV", func(t *testing.T) {
437437
assert := assert.New(t)
438438
githubEnvFile := t.TempDir() + "/github_env"
439-
require.NoError(t, os.WriteFile(githubEnvFile, []byte{}, 0644))
439+
require.NoError(t, os.WriteFile(githubEnvFile, []byte{}, 0o644))
440440
t.Setenv("GITHUB_ENV", githubEnvFile)
441441
for _, key := range tlsTrustEnvKeys {
442442
t.Setenv(key, "")

0 commit comments

Comments
 (0)