-
Notifications
You must be signed in to change notification settings - Fork 296
[docs] docs: reduce compilation-process.md by ~20% by removing redundant content #19664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,17 +9,9 @@ This guide documents the internal compilation process that transforms markdown w | |||||
|
|
||||||
| ## Overview | ||||||
|
|
||||||
| The `gh aw compile` command transforms a markdown file into a complete GitHub Actions workflow by embedding the frontmatter and setting up runtime loading of the markdown body. The GitHub Actions workflow will have multiple orchestrated jobs. | ||||||
| The `gh aw compile` command transforms a markdown workflow file into a complete GitHub Actions `.lock.yml` by embedding frontmatter and setting up runtime loading of the markdown body. The process runs five compilation phases (parsing, validation, job construction, dependency resolution, and YAML generation) described below. | ||||||
|
|
||||||
| This process involves: | ||||||
|
|
||||||
| 1. **Parsing** - Extract frontmatter and markdown content | ||||||
| 2. **Validation** - Verify configuration against JSON schemas | ||||||
| 3. **Job Building** - Create specialized jobs for different workflow stages | ||||||
| 4. **Dependency Management** - Establish job execution order | ||||||
| 5. **YAML Generation** - Output final `.lock.yml` file | ||||||
|
|
||||||
| When the workflow runs, the markdown body is loaded at runtime, allowing you to edit instructions without recompilation. See [Editing Workflows](/gh-aw/guides/editing-workflows/) for details. | ||||||
| When the workflow runs, the markdown body is loaded at runtime — you can edit instructions without recompilation. See [Editing Workflows](/gh-aw/guides/editing-workflows/) for details. | ||||||
|
|
||||||
| ## Compilation Phases | ||||||
|
|
||||||
|
|
@@ -69,44 +61,14 @@ Main Workflow | |||||
|
|
||||||
| See [Imports Reference](/gh-aw/reference/imports/) for complete merge semantics. | ||||||
|
|
||||||
| ### Phase 2: Job Construction | ||||||
|
|
||||||
| The compilation process builds multiple specialized jobs: | ||||||
|
|
||||||
| - Pre-activation job (if needed) | ||||||
| - Activation job | ||||||
| - Main agent job | ||||||
| - Safe output jobs | ||||||
| - Safe-jobs | ||||||
| - Custom jobs | ||||||
|
|
||||||
| ### Phase 3: Dependency Resolution | ||||||
|
|
||||||
| The compilation process validates and orders jobs: | ||||||
|
|
||||||
| - Checks all job dependencies exist | ||||||
| - Detects circular dependencies | ||||||
| - Computes topological execution order | ||||||
| - Generates Mermaid dependency graph | ||||||
|
|
||||||
| ### Phase 4: Action Pinning | ||||||
|
|
||||||
| All GitHub Actions are pinned to commit SHAs for security: | ||||||
|
|
||||||
| 1. Check action cache for cached resolution | ||||||
| 2. Try dynamic resolution via GitHub API | ||||||
| 3. Fall back to embedded action pins data | ||||||
| 4. Add version comment (e.g., `actions/checkout@sha # v6`) | ||||||
|
|
||||||
| ### Phase 5: YAML Generation | ||||||
|
|
||||||
| The compilation process assembles the final workflow: | ||||||
| ### Phases 2–5: Building the Workflow | ||||||
|
|
||||||
| - Renders workflow header with metadata comments | ||||||
| - Includes job dependency Mermaid graph | ||||||
| - Generates jobs in alphabetical order | ||||||
| - Embeds original prompt as comment | ||||||
| - Writes `.lock.yml` file | ||||||
| | Phase | Steps | | ||||||
| |-------|-------| | ||||||
| | **2 Job Construction** | Builds specialized jobs: pre-activation (if needed), activation, agent, safe outputs, safe-jobs, and custom jobs | | ||||||
| | **3 Dependency Resolution** | Validates job dependencies, detects circular references, computes topological order, generates Mermaid graph | | ||||||
| | **4 Action Pinning** | Pins all actions to SHAs: check cache → GitHub API → embedded pins → add version comment (e.g., `actions/checkout@sha # v6`) | | ||||||
| | **5 YAML Generation** | Assembles final `.lock.yml`: header with metadata, Mermaid dependency graph, alphabetical jobs, embedded original prompt | | ||||||
|
|
||||||
| ## Job Types | ||||||
|
|
||||||
|
|
@@ -181,9 +143,7 @@ graph LR | |||||
| add_comment --> conclusion | ||||||
| ``` | ||||||
|
|
||||||
| **Execution flow**: Pre-activation validates permissions → Activation prepares context → Agent executes AI → Detection scans output → Safe outputs run in parallel → Add comment waits for created items → Conclusion summarizes results. | ||||||
|
|
||||||
| Safe output jobs without cross-dependencies run concurrently for performance. When threat detection is enabled, safe outputs depend on both agent and detection jobs. | ||||||
| **Execution flow**: Pre-activation validates permissions → Activation prepares context → Agent executes AI → Detection scans output → Safe outputs run in parallel → Add comment waits for created items → Conclusion summarizes results. Safe output jobs without cross-dependencies run concurrently; when threat detection is enabled, safe outputs depend on both agent and detection jobs. | ||||||
|
||||||
| **Execution flow**: Pre-activation validates permissions → Activation prepares context → Agent executes AI → Detection scans output → Safe outputs run in parallel → Add comment waits for created items → Conclusion summarizes results. Safe output jobs without cross-dependencies run concurrently; when threat detection is enabled, safe outputs depend on both agent and detection jobs. | |
| **Execution flow**: Pre-activation validates permissions → Activation prepares context → Agent executes AI and runs inline threat detection → Safe-output jobs start only if the agent’s detection check succeeds (for example, `needs.agent.outputs.detection_success == 'true'`) and run in parallel where there are no cross-dependencies → Add comment waits for created items → Conclusion summarizes results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Overview lists five phases but omits action pinning, while the phase table below includes "4 Action Pinning" and Phase 1 combines parsing+validation. Please align the phase list with the headings used in this doc (e.g., include action pinning and/or use the same grouping/names as Phase 1 and Phases 2–5).
This issue also appears on line 206 of the same file.