From 497b18de8ee27c368a8e4d90c0e8943b2028bf67 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Jun 2026 00:53:30 +0000 Subject: [PATCH] Update agentic maintenance workflow header content Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/agentics-maintenance.yml | 20 +++++++++++--------- pkg/workflow/maintenance_workflow_test.go | 4 ++++ pkg/workflow/maintenance_workflow_yaml.go | 16 +++++++++------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/agentics-maintenance.yml b/.github/workflows/agentics-maintenance.yml index a82eeffc6e0..2c1975dfab9 100644 --- a/.github/workflows/agentics-maintenance.yml +++ b/.github/workflows/agentics-maintenance.yml @@ -21,15 +21,17 @@ # # For more information: https://github.github.com/gh-aw/introduction/overview/ # -# Alternative regeneration methods: -# make recompile -# -# Or use the gh-aw CLI directly: -# ./gh-aw compile --validate --verbose -# -# The workflow is generated when any workflow uses the 'expires' field -# in create-discussions, create-issues, or create-pull-request safe-outputs configuration. -# Schedule frequency is automatically determined by the shortest expiration time. +# This file defines the generated agentic maintenance workflow for this repository. +# It runs scheduled cleanup for expiring safe outputs and supports manual maintenance operations. +# +# This workflow is generated automatically when workflows use expiring safe outputs +# or when repository maintenance features are enabled in .github/workflows/aw.json. +# +# To disable maintenance workflow generation, set in .github/workflows/aw.json: +# {"maintenance": false} +# +# Agentic maintenance docs: +# https://github.github.com/gh-aw/reference/ephemerals/#manual-maintenance-operations # name: Agentic Maintenance diff --git a/pkg/workflow/maintenance_workflow_test.go b/pkg/workflow/maintenance_workflow_test.go index 810522a58db..287fcdf29cc 100644 --- a/pkg/workflow/maintenance_workflow_test.go +++ b/pkg/workflow/maintenance_workflow_test.go @@ -416,6 +416,10 @@ func TestGenerateMaintenanceWorkflow_OperationJobConditions(t *testing.T) { t.Fatalf("Expected maintenance workflow to be generated: %v", err) } yaml := string(content) + require.Contains(t, yaml, "This file defines the generated agentic maintenance workflow for this repository.") + require.Contains(t, yaml, "This workflow is generated automatically when workflows use expiring safe outputs") + require.Contains(t, yaml, `{"maintenance": false}`) + require.Contains(t, yaml, "https://github.github.com/gh-aw/reference/ephemerals/#manual-maintenance-operations") operationSkipCondition := `github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == ''` operationRunCondition := `(github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation != '' && inputs.operation != 'safe_outputs' && inputs.operation != 'create_labels' && inputs.operation != 'activity_report' && inputs.operation != 'close_agentic_workflows_issues' && inputs.operation != 'clean_cache_memories' && inputs.operation != 'update_pull_request_branches' && inputs.operation != 'validate' && inputs.operation != 'forecast'` diff --git a/pkg/workflow/maintenance_workflow_yaml.go b/pkg/workflow/maintenance_workflow_yaml.go index 9523fd6c0c2..648cd322762 100644 --- a/pkg/workflow/maintenance_workflow_yaml.go +++ b/pkg/workflow/maintenance_workflow_yaml.go @@ -54,15 +54,17 @@ func buildMaintenanceWorkflowYAML( var yaml strings.Builder // Add workflow header with logo and instructions - customInstructions := `Alternative regeneration methods: - make recompile + customInstructions := `This file defines the generated agentic maintenance workflow for this repository. +It runs scheduled cleanup for expiring safe outputs and supports manual maintenance operations. -Or use the gh-aw CLI directly: - ./gh-aw compile --validate --verbose +This workflow is generated automatically when workflows use expiring safe outputs +or when repository maintenance features are enabled in .github/workflows/aw.json. -The workflow is generated when any workflow uses the 'expires' field -in create-discussions, create-issues, or create-pull-request safe-outputs configuration. -Schedule frequency is automatically determined by the shortest expiration time.` +To disable maintenance workflow generation, set in .github/workflows/aw.json: + {"maintenance": false} + +Agentic maintenance docs: + https://github.github.com/gh-aw/reference/ephemerals/#manual-maintenance-operations` header := GenerateWorkflowHeader("", "pkg/workflow/maintenance_workflow.go", customInstructions) yaml.WriteString(header)