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 docs/src/content/docs/agent-factory-status.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ These are experimental agentic workflows used by the GitHub Next team to learn,
| [Smoke Codex](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-codex.md) | codex | [![Smoke Codex](https://github.com/github/gh-aw/actions/workflows/smoke-codex.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-codex.lock.yml) | - | - |
| [Smoke Copilot](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-copilot.md) | copilot | [![Smoke Copilot](https://github.com/github/gh-aw/actions/workflows/smoke-copilot.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-copilot.lock.yml) | - | - |
| [Smoke OpenCode](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-opencode.md) | copilot | [![Smoke OpenCode](https://github.com/github/gh-aw/actions/workflows/smoke-opencode.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-opencode.lock.yml) | - | - |
| [Smoke Project](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-project.md) | codex | [![Smoke Project](https://github.com/github/gh-aw/actions/workflows/smoke-project.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-project.lock.yml) | - | - |
| [Smoke Project](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-project.md) | copilot | [![Smoke Project](https://github.com/github/gh-aw/actions/workflows/smoke-project.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-project.lock.yml) | - | - |
| [Stale Repository Identifier](https://github.com/github/gh-aw/blob/main/.github/workflows/stale-repo-identifier.md) | copilot | [![Stale Repository Identifier](https://github.com/github/gh-aw/actions/workflows/stale-repo-identifier.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/stale-repo-identifier.lock.yml) | - | - |
| [Static Analysis Report](https://github.com/github/gh-aw/blob/main/.github/workflows/static-analysis-report.md) | claude | [![Static Analysis Report](https://github.com/github/gh-aw/actions/workflows/static-analysis-report.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/static-analysis-report.lock.yml) | - | - |
| [Step Name Alignment](https://github.com/github/gh-aw/blob/main/.github/workflows/step-name-alignment.md) | claude | [![Step Name Alignment](https://github.com/github/gh-aw/actions/workflows/step-name-alignment.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/step-name-alignment.lock.yml) | `daily` | - |
Expand Down
29 changes: 26 additions & 3 deletions pkg/workflow/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,19 @@ func formatCompilerMessage(filePath string, msgType string, message string) stri
})
}

// CompileWorkflow converts a markdown workflow to GitHub Actions YAML
// CompileWorkflow compiles a workflow markdown file into a GitHub Actions YAML file.
// It reads the file from disk, parses frontmatter and markdown sections, and generates
// the corresponding workflow YAML. Returns the compiled workflow data or an error.

Copilot AI Feb 8, 2026

Copy link

Choose a reason for hiding this comment

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

The docstring says this function "Returns the compiled workflow data or an error", but the signature returns only error. This is misleading in go doc output; adjust the comment to describe that it compiles and writes the lock YAML (and returns an error on failure).

This issue also appears on line 434 of the same file.

Suggested change
// the corresponding workflow YAML. Returns the compiled workflow data or an error.
// the corresponding workflow YAML, writing it to a .lock.yml file and returning an error on failure.

Copilot uses AI. Check for mistakes.
//
// The compilation process includes:
// - Reading and parsing the markdown file
// - Extracting frontmatter configuration
// - Validating workflow configuration
// - Generating GitHub Actions YAML
// - Writing the compiled workflow to a .lock.yml file
//
// This is the main entry point for compiling workflows from disk. For compiling
// pre-parsed workflow data, use CompileWorkflowData instead.
func (c *Compiler) CompileWorkflow(markdownPath string) error {
// Store markdownPath for use in dynamic tool generation
c.markdownPath = markdownPath
Expand Down Expand Up @@ -419,8 +431,19 @@ func (c *Compiler) writeWorkflowOutput(lockFile, yamlContent string, markdownPat
return nil
}

// CompileWorkflowData compiles a workflow from already-parsed WorkflowData
// This avoids re-parsing when the data has already been parsed
// CompileWorkflowData compiles pre-parsed workflow content into GitHub Actions YAML.
// Unlike CompileWorkflow, this accepts already-parsed frontmatter and markdown content
// rather than reading from disk. This is useful for testing and programmatic workflow generation.
//
// The compilation process includes:
// - Validating workflow configuration and features
// - Checking permissions and tool configurations
// - Generating GitHub Actions YAML structure
// - Writing the compiled workflow to a .lock.yml file
//
// This function avoids re-parsing when workflow data has already been extracted,
// making it efficient for scenarios where the same workflow is compiled multiple times
// or when workflow data comes from a non-file source.
func (c *Compiler) CompileWorkflowData(workflowData *WorkflowData, markdownPath string) error {
// Store markdownPath for use in dynamic tool generation and prompt generation
c.markdownPath = markdownPath
Expand Down
13 changes: 12 additions & 1 deletion pkg/workflow/compiler_jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,18 @@ func (c *Compiler) buildCustomJobs(data *WorkflowData, activationJobCreated bool
return nil
}

// shouldAddCheckoutStep determines if the checkout step should be added based on permissions and custom steps
// shouldAddCheckoutStep returns true if the workflow requires a checkout step.
// A checkout is needed when the workflow uses custom agent files, accesses local
// actions in dev/script mode, or needs to reference .github directory content.
//
// The checkout step is skipped in the following cases:
// - Custom steps already contain a checkout action
// - Workflow is in release mode without a custom agent file
//
// The checkout step is always added when:
// - A custom agent file is specified (via imports)
// - Running in dev or script mode (requires .github and .actions access)
// - Action mode is uninitialized (defaults to requiring checkout)
func (c *Compiler) shouldAddCheckoutStep(data *WorkflowData) bool {
// Check condition 1: If custom steps already contain checkout, don't add another one
if data.CustomSteps != "" && ContainsCheckout(data.CustomSteps) {
Expand Down
14 changes: 14 additions & 0 deletions pkg/workflow/compiler_orchestrator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Package workflow implements workflow compilation orchestration.
//
// The compiler orchestrator is split into 5 focused modules for maintainability:
//
// - orchestrator.go: Shared logger and constants used across orchestrator modules
// - orchestrator_engine.go: Engine detection, validation, and setup logic
// - orchestrator_frontmatter.go: Frontmatter parsing and validation
// - orchestrator_tools.go: Tool configuration and MCP server setup
// - orchestrator_workflow.go: Main workflow orchestration and YAML generation
//
// The orchestrator follows a phased approach with typed result structures
// for clear data flow between compilation stages. Each module handles a specific
// concern in the compilation pipeline, making the codebase easier to understand
// and maintain.
Comment on lines +1 to +14

Copilot AI Feb 8, 2026

Copy link

Choose a reason for hiding this comment

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

This file adds a second Package workflow ... comment. Because compiler_orchestrator.go sorts before doc.go, go doc pkg/workflow will likely show this orchestrator-specific text instead of the broader package documentation in pkg/workflow/doc.go. Consider removing the Package workflow header here (make it a regular file/module comment), or move/merge the orchestrator architecture section into doc.go so the package docs stay authoritative and accurate for the whole package.

This issue also appears on line 3 of the same file.

Copilot uses AI. Check for mistakes.
package workflow

import (
Expand Down
Loading