Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/daily-copilot-token-report.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/dead-code-remover.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/smoke-claude.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/smoke-codex.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/smoke-copilot-arm.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/smoke-copilot.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/smoke-test-tools.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/workflow/runtime_definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ var knownRuntimes = []*Runtime{
VersionField: "go-version",
DefaultVersion: string(constants.DefaultGoVersion),
Commands: []string{"go"},
ExtraWithFields: map[string]string{
"cache": "false", // Disable caching to prevent cache poisoning in agentic workflows
},
},
{
ID: "haskell",
Expand Down
4 changes: 3 additions & 1 deletion pkg/workflow/runtime_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ func TestGenerateRuntimeSetupSteps(t *testing.T) {
"Setup Go",
"actions/setup-go@",
"go-version: '1.22'",
"cache: false",
"Capture GOROOT for AWF chroot mode",
},
},
Expand All @@ -418,6 +419,7 @@ func TestGenerateRuntimeSetupSteps(t *testing.T) {
"Setup Go",
"actions/setup-go@",
"go-version: '1.25'",
"cache: false",
"Capture GOROOT for AWF chroot mode",
},
},
Expand All @@ -431,7 +433,7 @@ func TestGenerateRuntimeSetupSteps(t *testing.T) {
"Setup Go",
"actions/setup-go@",
"go-version-file: custom/go.mod",
"cache: true",
"cache: false",
"Capture GOROOT for AWF chroot mode",
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflow/runtime_step_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func generateSetupStep(req *RuntimeRequirement) GitHubActionStep {
if runtime.ID == "go" && req.GoModFile != "" {
step = append(step, " with:")
step = append(step, " go-version-file: "+req.GoModFile)
step = append(step, " cache: true")
step = append(step, " cache: false") // Disable caching to prevent cache poisoning in agentic workflows
// Add any extra fields from user's setup step (sorted for stable output)
Comment on lines 101 to 105
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Go go-version-file special-case bypasses the normal runtime.ExtraWithFields + req.ExtraFields merge logic and hardcodes cache: false. This duplicates behavior from the general path and can drift if more default ExtraWithFields are added for Go later (or if a caller ever sets req.ExtraFields["cache"], it could produce a duplicate YAML key). Consider reusing the same merge/sort logic in this branch: emit go-version-file first, then append merged extra fields (with user fields overriding runtime defaults).

See below for a potential fix:


		// Merge runtime default extra fields with user-provided ones, then disable cache.
		// This mirrors the general extra-field handling while ensuring cache is always false.
		extraFields := maps.Clone(runtime.ExtraWithFields)
		for key, value := range req.ExtraFields {
			extraFields[key] = value
		}
		// Disable caching to prevent cache poisoning in agentic workflows.
		extraFields["cache"] = false

		// Emit merged extra fields (sorted for stable output).
		var extraKeys []string
		for key := range extraFields {
			extraKeys = append(extraKeys, key)
		}
		sort.Strings(extraKeys)
		for _, key := range extraKeys {
			valueStr := formatYAMLValue(extraFields[key])

Copilot uses AI. Check for mistakes.
var extraKeys []string
for key := range req.ExtraFields {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ jobs:
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version: '1.25'
cache: false
- name: Capture GOROOT for AWF chroot mode
run: echo "GOROOT=$(go env GOROOT)" >> "$GITHUB_ENV"
- name: Create gh-aw temp directory
Expand Down
Loading