Skip to content
Merged
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
10 changes: 6 additions & 4 deletions pkg/workflow/container_services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,13 @@ This is a test without container.`,
inMainJob := false
foundContainer := false

agentJobLine := " " + string(constants.AgentJobName) + ":"
for i, line := range lines {
if strings.Contains(line, string(constants.AgentJobName)+":") {
if line == agentJobLine {
inMainJob = true
continue
}
if inMainJob && strings.HasPrefix(line, " ") && !strings.HasPrefix(line, " ") && line != " "+string(constants.AgentJobName)+":" {
if inMainJob && strings.HasPrefix(line, " ") && !strings.HasPrefix(line, " ") && line != agentJobLine {
Comment on lines +144 to +150
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

The agent-job detection change is applied here, but the same substring-based job detection pattern still exists in pkg/workflow/environment_test.go (see around environment_test.go:140-146). Because the generated header can include container image refs like "/agent:" inside the single-line "# gh-aw-manifest: ..." comment, that test loop is still vulnerable to the same false-positive and may keep failing CI. Consider applying the same exact-line match (or a shared helper) across all tests that scan for the agent job start.

Copilot uses AI. Check for mistakes.
// Found next job, stop looking
break
}
Expand Down Expand Up @@ -298,12 +299,13 @@ This is a test without services.`,
inMainJob := false
foundServices := false

agentJobLine := " " + string(constants.AgentJobName) + ":"
for _, line := range lines {
if strings.Contains(line, string(constants.AgentJobName)+":") {
if line == agentJobLine {
inMainJob = true
continue
}
if inMainJob && strings.HasPrefix(line, " ") && !strings.HasPrefix(line, " ") && line != " "+string(constants.AgentJobName)+":" {
if inMainJob && strings.HasPrefix(line, " ") && !strings.HasPrefix(line, " ") && line != agentJobLine {
// Found next job, stop looking
break
}
Expand Down
Loading