Skip to content

Commit 34b24f8

Browse files
Document shared workflow detection feature
Updates documentation to reflect the shared workflow detection feature added in PR #8468. Workflows without an 'on' field are now automatically detected as shared workflow components and skip compilation with an informative message. Changes: - Added shared workflow detection notes to CLI compile command docs - Added new "Shared Workflow Components" section to imports reference - Included example output showing the compiler's informative message 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent afecb3f commit 34b24f8

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

docs/src/content/docs/reference/imports.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,33 @@ Workflow instructions here...
3939
{{#import shared/common-tools.md}}
4040
```
4141

42+
## Shared Workflow Components
43+
44+
Workflows without an `on` field are automatically detected as shared workflow components. These files are validated but not compiled into GitHub Actions, as they are meant to be imported by other workflows. When you attempt to compile a shared workflow directly, the compiler displays an informative message and skips compilation:
45+
46+
```bash wrap
47+
$ gh aw compile shared/mcp/deepwiki.md
48+
ℹ️ Shared agentic workflow detected: deepwiki.md
49+
50+
This workflow is missing the 'on' field and will be treated as a shared workflow component.
51+
Shared workflows are reusable components meant to be imported by other workflows.
52+
53+
To use this shared workflow:
54+
1. Import it in another workflow's frontmatter:
55+
---
56+
on: issues
57+
imports:
58+
- shared/mcp/deepwiki.md
59+
---
60+
61+
2. Compile the workflow that imports it
62+
63+
Skipping compilation.
64+
✓ Compiled 1 workflow(s): 0 error(s), 0 warning(s)
65+
```
66+
67+
This allows you to organize reusable components in your repository without generating unnecessary lock files.
68+
4269
## Path Formats
4370
4471
Import paths support local files (`shared/file.md`, `../file.md`), remote repositories (`owner/repo/file.md@v1.0.0`), and section references (`file.md#SectionName`). Optional imports use `{{#import? file.md}}` syntax in markdown.

docs/src/content/docs/setup/cli.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ gh aw compile --purge # Remove orphaned .lock.yml files
208208

209209
**Strict Mode (`--strict`):** Enforces security best practices: no write permissions (use [safe-outputs](/gh-aw/reference/safe-outputs/)), explicit `network` config, no wildcard domains, pinned Actions, no deprecated fields. See [Strict Mode reference](/gh-aw/reference/frontmatter/#strict-mode-strict).
210210

211+
**Shared Workflows:** Workflows without an `on` field are automatically detected as shared workflow components intended for import by other workflows. These files are validated using a relaxed schema that permits optional markdown content and skip compilation with an informative message. To use a shared workflow, import it in another workflow's frontmatter or with markdown directives. See [Imports reference](/gh-aw/reference/imports/).
212+
211213
### Testing
212214

213215
#### `trial`

0 commit comments

Comments
 (0)