Skip to content

Commit 5515e6c

Browse files
docs: add gh aw fix command documentation (#6391)
1 parent 0361077 commit 5515e6c

File tree

1 file changed

+25
-1
lines changed
  • docs/src/content/docs/setup

1 file changed

+25
-1
lines changed

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,29 @@ Creates a markdown workflow file in `.github/workflows/` with template frontmatt
126126

127127
### Building
128128

129+
#### `fix`
130+
131+
Automatically fix deprecated workflow fields using codemods. Applies migrations for field renames and API changes to keep workflows up-to-date with the latest schema.
132+
133+
```bash wrap
134+
gh aw fix # Check all workflows (dry-run)
135+
gh aw fix --write # Fix all workflows
136+
gh aw fix my-workflow # Check specific workflow (dry-run)
137+
gh aw fix my-workflow --write # Fix specific workflow
138+
gh aw fix --list-codemods # List available codemods with versions
139+
```
140+
141+
**Options:** `--write` (apply changes to files, defaults to dry-run), `--list-codemods` (show available fixes with version information)
142+
143+
**Available Codemods:**
144+
- `timeout_minutes``timeout-minutes` (field rename, v0.1.0)
145+
- `network.firewall``sandbox.agent` (migration with value mapping, v0.1.0)
146+
- `on.command``on.slash_command` (trigger rename, v0.2.0)
147+
148+
The command runs in dry-run mode by default, showing what would be changed without modifying files. Use `--write` to apply the fixes. All changes preserve formatting, comments, and indentation.
149+
150+
**Integration:** The `fix` command is automatically run before compilation when using `gh aw compile --fix`, and is integrated into the build process via `make fix`.
151+
129152
#### `compile`
130153

131154
Compile Markdown workflows to GitHub Actions YAML. Remote imports are automatically cached in `.github/aw/imports/` for offline compilation.
@@ -136,13 +159,14 @@ gh aw compile my-workflow # Compile specific workflow
136159
gh aw compile --watch # Auto-recompile on changes
137160
gh aw compile --validate --strict # Schema + strict mode validation
138161
gh aw compile --validate --json # Validation with JSON output
162+
gh aw compile --fix # Run fix command before compilation
139163
gh aw compile --zizmor # Security scan (warnings)
140164
gh aw compile --strict --zizmor # Security scan (fails on findings)
141165
gh aw compile --dependabot # Generate dependency manifests
142166
gh aw compile --purge # Remove orphaned .lock.yml files
143167
```
144168

145-
**Options:** `--validate` (schema validation and container checks), `--strict` (strict mode validation for all workflows), `--zizmor` (security scanning with [zizmor](https://github.com/woodruffw/zizmor)), `--dependabot` (generate npm/pip/Go manifests and update dependabot.yml), `--json` (machine-readable JSON output), `--watch` (auto-recompile on changes), `--purge` (remove orphaned `.lock.yml` files)
169+
**Options:** `--validate` (schema validation and container checks), `--strict` (strict mode validation for all workflows), `--fix` (run `gh aw fix --write` before compiling), `--zizmor` (security scanning with [zizmor](https://github.com/woodruffw/zizmor)), `--dependabot` (generate npm/pip/Go manifests and update dependabot.yml), `--json` (machine-readable JSON output), `--watch` (auto-recompile on changes), `--purge` (remove orphaned `.lock.yml` files)
146170

147171
**Strict Mode (`--strict`):**
148172

0 commit comments

Comments
 (0)