Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions workflows/maintainer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
on:
workflow_dispatch:

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

---

# 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.

## Steps to follow:

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. **Install the latest gh-aw CLI extension**:
- Run `gh extension install githubnext/gh-aw || gh extension upgrade githubnext/gh-aw` to install or upgrade to the latest version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot move these instructions as steps in the front matter. No need to update since this is a new container.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the setup instructions (checkout repository, install gh CLI, install gh-aw extension) to the front matter steps: section. The AI agent instructions are now simplified since the environment is pre-configured. Commit ba594eb.

- Verify the installation by running `gh aw version` to check the current version

3. **Check the current workflows**:
- List all workflow markdown files in the `workflows/` directory
- Understand which workflows need to be compiled

4. **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

5. **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

6. **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:
- 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
- If you create a PR, make sure it includes all necessary changes for the workflows to compile