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
3 changes: 3 additions & 0 deletions docs/src/content/docs/status.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ Status of all agentic workflows. [Browse source files](https://github.com/github
| [Daily News](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/daily-news.md) | copilot | [![Daily News](https://github.com/githubnext/gh-aw/actions/workflows/daily-news.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/daily-news.lock.yml) | `0 9 * * 1-5` | - |
| [Daily Perf Improver](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/daily-perf-improver.md) | copilot | [![Daily Perf Improver](https://github.com/githubnext/gh-aw/actions/workflows/daily-perf-improver.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/daily-perf-improver.lock.yml) | `0 2 * * 1-5` | - |
| [Daily Test Coverage Improver](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/daily-test-improver.md) | copilot | [![Daily Test Coverage Improver](https://github.com/githubnext/gh-aw/actions/workflows/daily-test-improver.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/daily-test-improver.lock.yml) | `0 2 * * 1-5` | - |
| [Dependabot Go Module Dependency Checker](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/dependabot-go-checker.md) | copilot | [![Dependabot Go Module Dependency Checker](https://github.com/githubnext/gh-aw/actions/workflows/dependabot-go-checker.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/dependabot-go-checker.lock.yml) | `0 9 * * 1,3,5` | - |
| [Dev](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/dev.md) | copilot | [![Dev](https://github.com/githubnext/gh-aw/actions/workflows/dev.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/dev.lock.yml) | - | - |
| [Dev Firewall](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/dev.firewall.md) | copilot | [![Dev Firewall](https://github.com/githubnext/gh-aw/actions/workflows/dev.firewall.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/dev.firewall.lock.yml) | - | - |
| [Dev Hawk](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/dev-hawk.md) | copilot | [![Dev Hawk](https://github.com/githubnext/gh-aw/actions/workflows/dev-hawk.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/dev-hawk.lock.yml) | - | - |
| [Developer Documentation Consolidator](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/developer-docs-consolidator.md) | claude | [![Developer Documentation Consolidator](https://github.com/githubnext/gh-aw/actions/workflows/developer-docs-consolidator.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/developer-docs-consolidator.lock.yml) | `17 3 * * *` | - |
| [Dictation Prompt Generator](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/dictation-prompt.md) | copilot | [![Dictation Prompt Generator](https://github.com/githubnext/gh-aw/actions/workflows/dictation-prompt.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/dictation-prompt.lock.yml) | `0 6 * * 0` | - |
| [Documentation Unbloat](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/unbloat-docs.md) | claude | [![Documentation Unbloat](https://github.com/githubnext/gh-aw/actions/workflows/unbloat-docs.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/unbloat-docs.lock.yml) | `0 22 * * *` | `/unbloat` |
| [Duplicate Code Detector](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/duplicate-code-detector.md) | codex | [![Duplicate Code Detector](https://github.com/githubnext/gh-aw/actions/workflows/duplicate-code-detector.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/duplicate-code-detector.lock.yml) | `0 21 * * *` | - |
Expand All @@ -49,6 +51,7 @@ Status of all agentic workflows. [Browse source files](https://github.com/github
| [Mergefest](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/mergefest.md) | copilot | [![Mergefest](https://github.com/githubnext/gh-aw/actions/workflows/mergefest.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/mergefest.lock.yml) | - | `/mergefest` |
| [Plan Command](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/plan.md) | copilot | [![Plan Command](https://github.com/githubnext/gh-aw/actions/workflows/plan.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/plan.lock.yml) | - | `/plan` |
| [Poem Bot - A Creative Agentic Workflow](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/poem-bot.md) | copilot | [![Poem Bot - A Creative Agentic Workflow](https://github.com/githubnext/gh-aw/actions/workflows/poem-bot.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/poem-bot.lock.yml) | - | `/poem` |
| [PR Nitpick Reviewer 🔍](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/pr-nitpick-reviewer.md) | copilot | [![PR Nitpick Reviewer 🔍](https://github.com/githubnext/gh-aw/actions/workflows/pr-nitpick-reviewer.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/pr-nitpick-reviewer.lock.yml) | - | - |
| [Python Data Visualization Generator](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/python-data-charts.md) | copilot | [![Python Data Visualization Generator](https://github.com/githubnext/gh-aw/actions/workflows/python-data-charts.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/python-data-charts.lock.yml) | - | - |
| [Q](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/q.md) | copilot | [![Q](https://github.com/githubnext/gh-aw/actions/workflows/q.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/q.lock.yml) | - | `/q` |
| [Repository Tree Map Generator](https://github.com/githubnext/gh-aw/blob/main/.github/workflows/repo-tree-map.md) | copilot | [![Repository Tree Map Generator](https://github.com/githubnext/gh-aw/actions/workflows/repo-tree-map.lock.yml/badge.svg)](https://github.com/githubnext/gh-aw/actions/workflows/repo-tree-map.lock.yml) | `0 15 * * 1` | - |
Expand Down
48 changes: 48 additions & 0 deletions pkg/cli/add_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ Examples:
` + constants.CLIExtensionPrefix + ` add githubnext/agentics/workflows/ci-doctor.md@main
` + constants.CLIExtensionPrefix + ` add https://github.com/githubnext/agentics/blob/main/workflows/ci-doctor.md
` + constants.CLIExtensionPrefix + ` add githubnext/agentics/ci-doctor --pr --force
` + constants.CLIExtensionPrefix + ` add githubnext/agentics/*
` + constants.CLIExtensionPrefix + ` add githubnext/agentics/*@v1.0.0

Workflow specifications:
- Two parts: "owner/repo[@version]" (lists available workflows in the repository)
- Three parts: "owner/repo/workflow-name[@version]" (implicitly looks in workflows/ directory)
- Four+ parts: "owner/repo/workflows/workflow-name.md[@version]" (requires explicit .md extension)
- GitHub URL: "https://github.com/owner/repo/blob/branch/path/to/workflow.md"
- Wildcard: "owner/repo/*[@version]" (adds all workflows from the repository)
- Version can be tag, branch, or SHA

The -n flag allows you to specify a custom name for the workflow file (only applies to the first workflow when adding multiple).
Expand Down Expand Up @@ -192,6 +195,13 @@ func AddWorkflows(workflows []string, number int, verbose bool, engineOverride s
}
}

// Expand wildcards after installation
var err error
processedWorkflows, err = expandWildcardWorkflows(processedWorkflows, verbose)
if err != nil {
return err
}

// Handle PR creation workflow
if createPR {
addLog.Print("Creating workflow with PR")
Expand Down Expand Up @@ -893,3 +903,41 @@ func addSourceToWorkflow(content, source string) (string, error) {
// Use shared frontmatter logic that preserves formatting
return addFieldToFrontmatter(content, "source", source)
}

// expandWildcardWorkflows expands wildcard workflow specifications into individual workflow specs.
// For each wildcard spec, it discovers all workflows in the installed package and replaces
// the wildcard with the discovered workflows. Non-wildcard specs are passed through unchanged.
func expandWildcardWorkflows(specs []*WorkflowSpec, verbose bool) ([]*WorkflowSpec, error) {
expandedWorkflows := []*WorkflowSpec{}

for _, spec := range specs {
if spec.IsWildcard {
addLog.Printf("Expanding wildcard for repository: %s", spec.RepoSlug)
if verbose {
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Discovering workflows in %s...", spec.RepoSlug)))
}

discovered, err := discoverWorkflowsInPackage(spec.RepoSlug, spec.Version, verbose)
if err != nil {
return nil, fmt.Errorf("failed to discover workflows in %s: %w", spec.RepoSlug, err)
}

if len(discovered) == 0 {
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("No workflows found in %s", spec.RepoSlug)))
} else {
if verbose {
fmt.Fprintln(os.Stderr, console.FormatSuccessMessage(fmt.Sprintf("Found %d workflow(s) in %s", len(discovered), spec.RepoSlug)))
}
expandedWorkflows = append(expandedWorkflows, discovered...)
}
} else {
expandedWorkflows = append(expandedWorkflows, spec)
}
}

if len(expandedWorkflows) == 0 {
return nil, fmt.Errorf("no workflows to add after expansion")
}

return expandedWorkflows, nil
}
Loading
Loading