Skip to content

Commit 68a755c

Browse files
authored
Add gh aw fix step to maintainer workflow for automatic codemod application (#91)
1 parent 5457766 commit 68a755c

File tree

2 files changed

+61
-75
lines changed

2 files changed

+61
-75
lines changed

.github/workflows/maintainer.lock.yml

Lines changed: 48 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/maintainer.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,33 @@ Your name is "${{ github.workflow }}". Your job is to upgrade the workflows in t
4848
- Review and understand the interesting changes, breaking changes, and new features in the latest version
4949
- Pay special attention to any migration guides or upgrade instructions
5050

51-
2. **Attempt to recompile the workflows**:
51+
2. **Apply automatic fixes with codemods**:
52+
- Run `gh aw fix --write` to apply all available codemods that automatically fix deprecated fields and migrate to new syntax
53+
- This will update workflow files with changes like:
54+
- Replacing 'timeout_minutes' with 'timeout-minutes'
55+
- Replacing 'network.firewall' with 'sandbox.agent: false'
56+
- Removing deprecated 'safe-inputs.mode' field
57+
- Review the output to see what changes were made
58+
59+
3. **Attempt to recompile the workflows**:
5260
- Clean up any existing `.lock.yml` files: `find workflows -name "*.lock.yml" -type f -delete`
5361
- Run `gh aw compile --validate` on each workflow file in the `workflows/` directory
5462
- Note any compilation errors or warnings
5563

56-
3. **Fix compilation errors if they occur**:
64+
4. **Fix compilation errors if they occur**:
5765
- If there are compilation errors, analyze them carefully
5866
- Review the gh-aw changelog and new documentation you fetched earlier
5967
- Identify what changes are needed in the workflow files to make them compatible with the new version
6068
- Make the necessary changes to the workflow markdown files to fix the errors
6169
- Re-run `gh aw compile --validate` to verify the fixes work
6270
- Iterate until all workflows compile successfully or you've exhausted reasonable fix attempts
6371

64-
4. **Create appropriate outputs**:
72+
5. **Create appropriate outputs**:
6573
- **If all workflows compile successfully**: Create a pull request with the title "Upgrade workflows to latest gh-aw version" containing:
66-
- All updated workflow files
74+
- All updated workflow files (including any codemod changes from `gh aw fix`)
6775
- Any generated `.lock.yml` files
6876
- A detailed description of what changed, referencing the gh-aw changelog
77+
- A summary of any automatic fixes applied by codemods
6978
- A summary of any manual fixes that were needed
7079

7180
- **If there are compilation errors you cannot fix**: Create an issue with the title "Failed to upgrade workflows to latest gh-aw version" containing:

0 commit comments

Comments
 (0)