|
| 1 | +--- |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + repository_dispatch: |
| 5 | + types: [maintainer] |
| 6 | + |
| 7 | +permissions: read-all |
| 8 | + |
| 9 | +network: defaults |
| 10 | + |
| 11 | +safe-outputs: |
| 12 | + create-pull-request: |
| 13 | + draft: false |
| 14 | + create-issue: |
| 15 | + title-prefix: "${{ github.workflow }}" |
| 16 | + |
| 17 | +tools: |
| 18 | + github: |
| 19 | + toolset: [all] |
| 20 | + edit: true |
| 21 | + web-fetch: |
| 22 | + bash: [ ":*" ] |
| 23 | + |
| 24 | +timeout_minutes: 30 |
| 25 | + |
| 26 | +steps: |
| 27 | + - name: Checkout repository |
| 28 | + uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Install gh-aw extension |
| 31 | + run: | |
| 32 | + gh extension install githubnext/gh-aw |
| 33 | + env: |
| 34 | + GH_TOKEN: ${{ github.token }} |
| 35 | + |
| 36 | + - name: Verify gh-aw installation |
| 37 | + run: gh aw version |
| 38 | + env: |
| 39 | + GH_TOKEN: ${{ github.token }} |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +# Agentic Workflow Maintainer |
| 44 | + |
| 45 | +Your name is "${{ github.workflow }}". Your job is to upgrade the workflows in the GitHub repository `${{ github.repository }}` to the latest version of gh-aw. |
| 46 | + |
| 47 | +## Instructions |
| 48 | + |
| 49 | +1. **Fetch the latest gh-aw changes**: |
| 50 | + - Use the GitHub tools to fetch the CHANGELOG.md or release notes from the `githubnext/gh-aw` repository |
| 51 | + - Review and understand the interesting changes, breaking changes, and new features in the latest version |
| 52 | + - Pay special attention to any migration guides or upgrade instructions |
| 53 | + |
| 54 | +2. **Attempt to recompile the workflows**: |
| 55 | + - Clean up any existing `.lock.yml` files: `find workflows -name "*.lock.yml" -type f -delete` |
| 56 | + - Run `gh aw compile --validate` on each workflow file in the `workflows/` directory |
| 57 | + - Note any compilation errors or warnings |
| 58 | + |
| 59 | +3. **Fix compilation errors if they occur**: |
| 60 | + - If there are compilation errors, analyze them carefully |
| 61 | + - Review the gh-aw changelog and new documentation you fetched earlier |
| 62 | + - Identify what changes are needed in the workflow files to make them compatible with the new version |
| 63 | + - Make the necessary changes to the workflow markdown files to fix the errors |
| 64 | + - Re-run `gh aw compile --validate` to verify the fixes work |
| 65 | + - Iterate until all workflows compile successfully or you've exhausted reasonable fix attempts |
| 66 | + |
| 67 | +4. **Create appropriate outputs**: |
| 68 | + - **If all workflows compile successfully**: Create a pull request with the title "Upgrade workflows to latest gh-aw version" containing: |
| 69 | + - All updated workflow files |
| 70 | + - Any generated `.lock.yml` files |
| 71 | + - A detailed description of what changed, referencing the gh-aw changelog |
| 72 | + - A summary of any manual fixes that were needed |
| 73 | + |
| 74 | + - **If there are compilation errors you cannot fix**: Create an issue with the title "Failed to upgrade workflows to latest gh-aw version" containing: |
| 75 | + - The specific compilation errors you encountered |
| 76 | + - What you tried to fix them |
| 77 | + - Links to relevant sections of the gh-aw changelog or documentation |
| 78 | + - The version of gh-aw you were trying to upgrade to |
| 79 | + |
| 80 | +## Important notes |
| 81 | +- The gh-aw CLI extension has already been installed and is available for use |
| 82 | +- Always check the gh-aw changelog first to understand breaking changes |
| 83 | +- Test each fix by running `gh aw compile --validate` before moving to the next error |
| 84 | +- Include context and reasoning in your PR or issue descriptions |
| 85 | + |
0 commit comments