From d204cc51b4888b828a8dc7dcccd7e12a745d512f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 17:25:32 +0000 Subject: [PATCH 1/2] Initial plan From 8a6eeb32f95567d6bf5e60a72413118f633112cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 17:42:37 +0000 Subject: [PATCH 2/2] Fix shouldAddCheckoutStep to respect ActionMode - In release mode without an agent file, skip automatic checkout since actions are pinned to remote refs and don't require .github/actions - In dev/script mode or with uninitialized mode, add checkout for local .github and .actions access - Preserves existing behavior for agent file imports and custom steps Fixes failing test: TestCheckoutWithAgentFromImports/no_checkout_without_agent_and_permissions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/workflow/compiler_jobs.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/workflow/compiler_jobs.go b/pkg/workflow/compiler_jobs.go index 7f4d793969..2fcf669ee5 100644 --- a/pkg/workflow/compiler_jobs.go +++ b/pkg/workflow/compiler_jobs.go @@ -446,8 +446,15 @@ func (c *Compiler) shouldAddCheckoutStep(data *WorkflowData) bool { return true // Custom agent file requires checkout to access the file } - // Agent job always gets contents: read permission for .github and .actions access - // Therefore, we always add checkout for runtime-import and workflow files - log.Print("Adding checkout step: agent job has contents read access for .github and .actions") + // Check condition 3: Only skip checkout in explicit release mode without agent file + // Dev mode, script mode, and uninitialized mode all need checkout for .github and .actions access + if c.actionMode.IsRelease() { + // In release mode without agent file, checkout is not needed + log.Print("Skipping checkout step: release mode without agent file") + return false + } + + // Default: add checkout for dev/script mode and uninitialized mode + log.Printf("Adding checkout step: %s mode requires .github and .actions access", c.actionMode) return true }