-
Notifications
You must be signed in to change notification settings - Fork 39
Add maintainer workflow for automated gh-aw upgrades #55
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 6 commits
8b89bd3
bb7c8ba
bc13223
e7a30f4
ba594eb
a05b7bd
74cedae
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 |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| --- | ||
| on: | ||
| workflow_dispatch: | ||
| repository_dispatch: | ||
| types: [maintainer] | ||
|
|
||
| permissions: read-all | ||
|
|
||
| network: defaults | ||
|
|
||
| safe-outputs: | ||
| create-pull-request: | ||
| draft: false | ||
| create-issue: | ||
| title-prefix: "${{ github.workflow }}" | ||
|
|
||
| tools: | ||
| github: | ||
| toolset: [all] | ||
| edit: true | ||
| web-fetch: | ||
| bash: [ ":*" ] | ||
|
|
||
| timeout_minutes: 30 | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install gh CLI | ||
| run: | | ||
| type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) | ||
| curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ | ||
| && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ | ||
| && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ | ||
| && sudo apt update \ | ||
| && sudo apt install gh -y | ||
|
|
||
| - name: Install gh-aw extension | ||
| run: | | ||
| gh extension install githubnext/gh-aw || gh extension upgrade githubnext/gh-aw | ||
|
||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
|
|
||
| - name: Verify gh-aw installation | ||
| run: gh aw version | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
|
|
||
| --- | ||
|
|
||
| # Agentic Workflow Maintainer | ||
|
|
||
| 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. | ||
|
|
||
| ## Instructions | ||
|
|
||
| 1. **Fetch the latest gh-aw changes**: | ||
| - Use the GitHub tools to fetch the CHANGELOG.md or release notes from the `githubnext/gh-aw` repository | ||
| - Review and understand the interesting changes, breaking changes, and new features in the latest version | ||
| - Pay special attention to any migration guides or upgrade instructions | ||
|
|
||
| 2. **Attempt to recompile the workflows**: | ||
| - Clean up any existing `.lock.yml` files: `find workflows -name "*.lock.yml" -type f -delete` | ||
| - Run `gh aw compile --validate` on each workflow file in the `workflows/` directory | ||
| - Note any compilation errors or warnings | ||
|
|
||
| 3. **Fix compilation errors if they occur**: | ||
| - If there are compilation errors, analyze them carefully | ||
| - Review the gh-aw changelog and new documentation you fetched earlier | ||
| - Identify what changes are needed in the workflow files to make them compatible with the new version | ||
| - Make the necessary changes to the workflow markdown files to fix the errors | ||
| - Re-run `gh aw compile --validate` to verify the fixes work | ||
| - Iterate until all workflows compile successfully or you've exhausted reasonable fix attempts | ||
|
|
||
| 4. **Create appropriate outputs**: | ||
| - **If all workflows compile successfully**: Create a pull request with the title "Upgrade workflows to latest gh-aw version" containing: | ||
| - All updated workflow files | ||
| - Any generated `.lock.yml` files | ||
| - A detailed description of what changed, referencing the gh-aw changelog | ||
| - A summary of any manual fixes that were needed | ||
|
|
||
| - **If there are compilation errors you cannot fix**: Create an issue with the title "Failed to upgrade workflows to latest gh-aw version" containing: | ||
| - The specific compilation errors you encountered | ||
| - What you tried to fix them | ||
| - Links to relevant sections of the gh-aw changelog or documentation | ||
| - The version of gh-aw you were trying to upgrade to | ||
|
|
||
| ## Important notes | ||
| - The gh-aw CLI extension has already been installed and is available for use | ||
| - Always check the gh-aw changelog first to understand breaking changes | ||
| - Test each fix by running `gh aw compile --validate` before moving to the next error | ||
| - Include context and reasoning in your PR or issue descriptions | ||
|
|
||
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.
@copilot remove, gh cli is pre installed in actions
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.
Removed the "Install gh CLI" step since gh CLI is pre-installed in GitHub Actions. Commit 74cedae.