Skip to content

Generate maintenance workflow when compiling specific files#10883

Merged
pelikhan merged 5 commits intomainfrom
copilot/generate-agentic-maintenance-workflow
Jan 20, 2026
Merged

Generate maintenance workflow when compiling specific files#10883
pelikhan merged 5 commits intomainfrom
copilot/generate-agentic-maintenance-workflow

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

Maintenance workflow generation was only triggered when compiling all workflows (gh aw compile), not when compiling specific files (gh aw compile workflow1.md workflow2.md).

Changes

  • Modified runPostProcessing to generate maintenance workflow for specific file compilation
  • Added parseAllWorkflowsInDirectory helper that scans all .md files in the workflow directory to detect expires field usage, ensuring maintenance workflow reflects the full directory state regardless of which files were compiled
  • Fixed workflow directory resolution to default to .github/workflows when config.WorkflowDir is empty
  • Skip maintenance workflow generation when using custom --dir option to avoid generating maintenance workflows in non-standard directories

Behavior

# Now generates/updates agentics-maintenance.yml in default directory scenarios
gh aw init                              # ✓ (already worked)
gh aw compile                           # ✓ (already worked)
gh aw compile workflow1.md workflow2.md # ✓ (now fixed)

# Skips maintenance workflow generation for custom directories
gh aw compile --dir custom/workflows    # ✓ (no maintenance workflow generated)

The maintenance workflow is generated/updated when any workflow uses safe-outputs.create-issue.expires or safe-outputs.create-discussion.expires, and deleted when none do. This only applies to the default .github/workflows directory.

Testing

  • ✅ Added TestCompileSpecificFiles_GeneratesMaintenanceWorkflow to verify maintenance workflow generation for specific files
  • ✅ Added TestCompileSpecificFiles_DeletesMaintenanceWorkflow to verify deletion when no expires fields exist
  • ✅ Added TestCompileWithCustomDir_SkipsMaintenanceWorkflow to verify skipping behavior for custom directories

Custom agent used: w3c-specification-writer
AI technical specification writer following W3C conventions and best practices for formal specifications

Original prompt

The "agentic-maintenance" workflow should be generated as part of running "init" and recompiling all workflows.

Custom agent used: w3c-specification-writer
AI technical specification writer following W3C conventions and best practices for formal specifications


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 20, 2026 18:10
- Add maintenance workflow generation to runPostProcessing function in compile_orchestration.go
- When compiling specific files, parse ALL workflows in the directory to check for expires fields
- Create parseAllWorkflowsInDirectory helper function to parse all workflows in directory
- Add tests to verify maintenance workflow generation for specific files
- Fix: Use default workflow dir (.github/workflows) when not specified
- Tests: TestCompileSpecificFiles_GeneratesMaintenanceWorkflow and TestCompileSpecificFiles_DeletesMaintenanceWorkflow

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add agentic-maintenance workflow generation on init Generate maintenance workflow when compiling specific files Jan 20, 2026
Copilot AI requested a review from pelikhan January 20, 2026 18:17
@pelikhan
Copy link
Contributor

@copilot ignore agentic-maintenance if --dir option is used

@pelikhan pelikhan marked this pull request as ready for review January 20, 2026 18:28
- Modified runPostProcessing and runPostProcessingForDirectory to check if config.WorkflowDir is empty
- Maintenance workflow is only generated for default .github/workflows directory
- Added test TestCompileWithCustomDir_SkipsMaintenanceWorkflow to verify behavior
- Updated existing tests to use empty WorkflowDir (default) instead of explicit ".github/workflows"

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 20, 2026

@copilot ignore agentic-maintenance if --dir option is used

Done. The maintenance workflow is now skipped when using the --dir option. Changes implemented in commit ff2a7be:

  • Maintenance workflow only generated for default .github/workflows directory
  • Skipped when using custom directory (e.g., gh aw compile --dir custom/workflows)
  • Added test TestCompileWithCustomDir_SkipsMaintenanceWorkflow to verify the behavior

@pelikhan pelikhan merged commit 3f8861f into main Jan 20, 2026
@pelikhan pelikhan deleted the copilot/generate-agentic-maintenance-workflow branch January 20, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants