From 902405f31915a474838ae4efe674cfe8372e2ff0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 19:12:41 +0000 Subject: [PATCH 1/2] Initial plan From ceaebcce54de36edd2d19d9f97b2cc7ae5ef55ed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 19:34:43 +0000 Subject: [PATCH 2/2] Fix GH_AW_STOP_TIME YAML type error: quote stop time value to prevent time.Time parsing The stop time value written to compiled workflow YAML (e.g. '2026-03-03 16:27:58') was unquoted, causing YAML parsers to interpret it as time.Time instead of a string. This failed the GitHub Actions JSON schema validation for env var values. - Quote GH_AW_STOP_TIME using %q in compiler_pre_activation_job.go - Update legacy ExtractStopTimeFromLockFile to strip surrounding quotes - Add test case for quoted stop time format - Regenerate all 177 workflow lock files (was 175/177 compiling) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c163050b-2cf4-424f-9c20-58956fe03d98 --- .github/workflows/ci-doctor.lock.yml | 2 +- .github/workflows/daily-team-status.lock.yml | 2 +- pkg/workflow/compiler_pre_activation_job.go | 2 +- pkg/workflow/stop_after.go | 5 ++++- pkg/workflow/stop_after_test.go | 15 +++++++++++++++ 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-doctor.lock.yml b/.github/workflows/ci-doctor.lock.yml index 6cb77c3c0b5..a19363a9c3a 100644 --- a/.github/workflows/ci-doctor.lock.yml +++ b/.github/workflows/ci-doctor.lock.yml @@ -1245,7 +1245,7 @@ jobs: id: check_stop_time uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 env: - GH_AW_STOP_TIME: 2026-03-03 16:27:58 + GH_AW_STOP_TIME: "2026-03-03 16:27:58" GH_AW_WORKFLOW_NAME: "CI Failure Doctor" with: script: | diff --git a/.github/workflows/daily-team-status.lock.yml b/.github/workflows/daily-team-status.lock.yml index f7b9c7ba080..05af7a6e46c 100644 --- a/.github/workflows/daily-team-status.lock.yml +++ b/.github/workflows/daily-team-status.lock.yml @@ -1014,7 +1014,7 @@ jobs: id: check_stop_time uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 env: - GH_AW_STOP_TIME: 2026-02-09 04:24:39 + GH_AW_STOP_TIME: "2026-02-09 04:24:39" GH_AW_WORKFLOW_NAME: "Daily Team Status" with: script: | diff --git a/pkg/workflow/compiler_pre_activation_job.go b/pkg/workflow/compiler_pre_activation_job.go index a049bd25927..b226daaefae 100644 --- a/pkg/workflow/compiler_pre_activation_job.go +++ b/pkg/workflow/compiler_pre_activation_job.go @@ -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)) steps = append(steps, fmt.Sprintf(" GH_AW_WORKFLOW_NAME: %q\n", workflowName)) steps = append(steps, " with:\n") steps = append(steps, " script: |\n") diff --git a/pkg/workflow/stop_after.go b/pkg/workflow/stop_after.go index 7353297aa7e..618dc106e02 100644 --- a/pkg/workflow/stop_after.go +++ b/pkg/workflow/stop_after.go @@ -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 } } } diff --git a/pkg/workflow/stop_after_test.go b/pkg/workflow/stop_after_test.go index 6aa669e87e5..a785a2f8923 100644 --- a/pkg/workflow/stop_after_test.go +++ b/pkg/workflow/stop_after_test.go @@ -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 {