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
2 changes: 1 addition & 1 deletion .github/workflows/ci-doctor.lock.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/daily-team-status.lock.yml

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

2 changes: 1 addition & 1 deletion pkg/workflow/compiler_pre_activation_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (c *Compiler) buildPreActivationJob(data *WorkflowData, needsPermissionChec
steps = append(steps, " env:\n")
// Strip ANSI escape codes from stop-time value
cleanStopTime := stringutil.StripANSI(data.StopTime)
steps = append(steps, fmt.Sprintf(" GH_AW_STOP_TIME: %s\n", cleanStopTime))
steps = append(steps, fmt.Sprintf(" GH_AW_STOP_TIME: %q\n", cleanStopTime))
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

Switching GH_AW_STOP_TIME emission to %q means the compiled YAML now contains a quoted timestamp. The integration test pkg/workflow/time_delta_integration_test.go currently parses the value by trimming whitespace and then calling time.Parse("2006-01-02 15:04:05", timestamp) without stripping quotes, so it will fail when run with -tags integration. Consider updating that test (or factoring out a shared helper) to trim surrounding quotes before parsing.

Suggested change
steps = append(steps, fmt.Sprintf(" GH_AW_STOP_TIME: %q\n", cleanStopTime))
steps = append(steps, fmt.Sprintf(" GH_AW_STOP_TIME: %s\n", cleanStopTime))

Copilot uses AI. Check for mistakes.
steps = append(steps, fmt.Sprintf(" GH_AW_WORKFLOW_NAME: %q\n", workflowName))
steps = append(steps, " with:\n")
steps = append(steps, " script: |\n")
Expand Down
5 changes: 4 additions & 1 deletion pkg/workflow/stop_after.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ func ExtractStopTimeFromLockFile(lockFilePath string) string {
if strings.Contains(line, "GH_AW_STOP_TIME:") {
prefix := "GH_AW_STOP_TIME:"
if _, after, ok := strings.Cut(line, prefix); ok {
return strings.TrimSpace(after)
extracted := strings.TrimSpace(after)
// Strip surrounding quotes added by newer compiler versions
extracted = strings.Trim(extracted, "\"")
return extracted
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions pkg/workflow/stop_after_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ jobs:
GH_AW_WORKFLOW_NAME: "Test Workflow"`,
expectedTime: "2025-06-01 12:00:00",
},
{
name: "GH_AW_STOP_TIME quoted (new format)",
lockContent: `name: Test Workflow
on:
workflow_dispatch:
jobs:
stop_time_check:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v8
env:
GH_AW_STOP_TIME: "2025-12-31 23:59:59"
GH_AW_WORKFLOW_NAME: "Test Workflow"`,
expectedTime: "2025-12-31 23:59:59",
},
}

for _, tt := range tests {
Expand Down
Loading