From 59ba40a7caa9c463f657c73959e4191eae233ab2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 12:48:06 +0000 Subject: [PATCH 1/2] Initial plan From 5cbdbdcd20b956caaf937f63a233c62895fe5b5c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 13:03:51 +0000 Subject: [PATCH 2/2] fix: convert non-string step env values to strings during compilation Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a16e41b7-6067-4189-95c1-e82175e99aea Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../workflows/stale-repo-identifier.lock.yml | 1 + pkg/workflow/step_types.go | 3 ++ pkg/workflow/step_types_test.go | 30 +++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/.github/workflows/stale-repo-identifier.lock.yml b/.github/workflows/stale-repo-identifier.lock.yml index 11664887275..63a5d854229 100644 --- a/.github/workflows/stale-repo-identifier.lock.yml +++ b/.github/workflows/stale-repo-identifier.lock.yml @@ -377,6 +377,7 @@ jobs: ADDITIONAL_METRICS: release,pr EXEMPT_TOPICS: keep,template GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INACTIVE_DAYS: "365" ORGANIZATION: ${{ env.ORGANIZATION }} id: stale-repos name: Run stale-repos tool diff --git a/pkg/workflow/step_types.go b/pkg/workflow/step_types.go index 8f43e2c1863..1203567c34a 100644 --- a/pkg/workflow/step_types.go +++ b/pkg/workflow/step_types.go @@ -113,6 +113,9 @@ func MapToStep(stepMap map[string]any) (*WorkflowStep, error) { for k, v := range env { if strVal, ok := v.(string); ok { step.Env[k] = strVal + } else if v != nil { + // Convert non-string values (int, float, bool, etc.) to their string representation + step.Env[k] = fmt.Sprint(v) } } } diff --git a/pkg/workflow/step_types_test.go b/pkg/workflow/step_types_test.go index a3b35902247..bdf62230ecc 100644 --- a/pkg/workflow/step_types_test.go +++ b/pkg/workflow/step_types_test.go @@ -232,6 +232,36 @@ func TestMapToStep(t *testing.T) { }, wantErr: false, }, + { + name: "step with integer and bool env values", + stepMap: map[string]any{ + "name": "Run stale-repos tool", + "id": "stale-repos", + "uses": "github/stale-repos@v9.0.6", + "env": map[string]any{ + "GH_TOKEN": "${{ secrets.GITHUB_TOKEN }}", + "ORGANIZATION": "${{ env.ORGANIZATION }}", + "EXEMPT_TOPICS": "keep,template", + "INACTIVE_DAYS": 365, + "ADDITIONAL_METRICS": "release,pr", + "DRY_RUN": true, + }, + }, + want: &WorkflowStep{ + Name: "Run stale-repos tool", + ID: "stale-repos", + Uses: "github/stale-repos@v9.0.6", + Env: map[string]string{ + "GH_TOKEN": "${{ secrets.GITHUB_TOKEN }}", + "ORGANIZATION": "${{ env.ORGANIZATION }}", + "EXEMPT_TOPICS": "keep,template", + "INACTIVE_DAYS": "365", + "ADDITIONAL_METRICS": "release,pr", + "DRY_RUN": "true", + }, + }, + wantErr: false, + }, } for _, tt := range tests {