|
| 1 | +# 🔧 Maintainer Workflow |
| 2 | + |
| 3 | +> For an overview of all available workflows, see the [main README](../README.md). |
| 4 | +
|
| 5 | +The [maintainer workflow](../workflows/maintainer.md?plain=1) helps keep your agentic workflows up to date by automatically upgrading them to the latest version of gh-aw. It fetches the latest changes from the gh-aw repository, attempts to recompile all workflows, and either creates a pull request with the updates or an issue if compilation errors occur. |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +```bash |
| 10 | +# Install the 'gh aw' extension |
| 11 | +gh extension install githubnext/gh-aw |
| 12 | + |
| 13 | +# Add the Maintainer workflow to your repository |
| 14 | +gh aw add githubnext/agentics/maintainer --pr |
| 15 | +``` |
| 16 | + |
| 17 | +This creates a pull request to add the workflow to your repository. After merging the PR and syncing to main, you can start a run of this workflow immediately by running: |
| 18 | + |
| 19 | +```bash |
| 20 | +gh aw run maintainer |
| 21 | +``` |
| 22 | + |
| 23 | +**Mandatory Checklist** |
| 24 | + |
| 25 | +* [ ] I am a repository admin or have sufficient permissions, and am happy for the safe-outputs portion of this workflow to create pull requests or issues in the repository. |
| 26 | + |
| 27 | +* [ ] I have enabled "Allow GitHub Actions to create and approve pull requests" in the repository settings under "Actions > General" |
| 28 | + |
| 29 | +* [ ] If in a fork, I have enabled "GitHub Actions" and "GitHub Issues" in the fork repository settings |
| 30 | + |
| 31 | +* [ ] I will review all pull requests very carefully and monitor the repository. |
| 32 | + |
| 33 | +## What it does |
| 34 | + |
| 35 | +1. **Fetches latest gh-aw changes**: Retrieves the CHANGELOG.md or release notes from the `githubnext/gh-aw` repository to understand new features, breaking changes, and migration instructions. |
| 36 | + |
| 37 | +2. **Installs latest gh-aw**: Upgrades the gh-aw CLI extension to the latest version using the GitHub token. |
| 38 | + |
| 39 | +3. **Attempts recompilation**: Tries to recompile all workflows in the `workflows/` directory with the new gh-aw version. |
| 40 | + |
| 41 | +4. **Fixes compilation errors**: If errors occur, analyzes them using the changelog and documentation, then attempts to fix the workflow files. |
| 42 | + |
| 43 | +5. **Creates outputs**: |
| 44 | + - **Success**: Creates a pull request with upgraded workflows and any necessary fixes |
| 45 | + - **Failure**: Creates an issue documenting the compilation errors and attempted fixes |
| 46 | + |
| 47 | +## Configuration |
| 48 | + |
| 49 | +This workflow requires no configuration and works out of the box. It will process all workflow markdown files in the `workflows/` directory. |
| 50 | + |
| 51 | +## What it reads from GitHub |
| 52 | + |
| 53 | +- Repository contents and workflow files |
| 54 | +- CHANGELOG.md from the `githubnext/gh-aw` repository |
| 55 | +- Release information and documentation from gh-aw |
| 56 | + |
| 57 | +## What it creates |
| 58 | + |
| 59 | +- Creates pull requests with upgraded workflows (if successful) |
| 60 | +- Creates issues documenting upgrade failures (if compilation errors persist) |
| 61 | +- Makes file changes to workflow files to fix compatibility issues |
| 62 | +- May generate `.lock.yml` files during compilation |
| 63 | +- Requires `contents: write`, `pull-requests: write`, and `issues: write` permissions |
| 64 | + |
| 65 | +## Human in the loop |
| 66 | + |
| 67 | +- Review pull requests created by this workflow to understand what changed |
| 68 | +- Test the upgraded workflows before merging |
| 69 | +- Investigate issues created by the workflow if compilation fails |
| 70 | +- Manually fix complex migration issues that the workflow couldn't handle |
| 71 | +- Disable or uninstall the workflow if not needed regularly |
| 72 | + |
| 73 | +## When to run |
| 74 | + |
| 75 | +- Run this workflow when you know a new version of gh-aw has been released |
| 76 | +- Run it periodically (e.g., monthly) to stay up to date |
| 77 | +- Run it before making other workflow changes to ensure compatibility |
| 78 | +- Trigger manually via workflow_dispatch when needed |
| 79 | + |
| 80 | +## Troubleshooting |
| 81 | + |
| 82 | +If the workflow creates an issue instead of a PR: |
| 83 | +1. Review the issue to understand what compilation errors occurred |
| 84 | +2. Check the gh-aw changelog for migration instructions |
| 85 | +3. Manually update the affected workflows based on the guidance |
| 86 | +4. Re-run the maintainer workflow to verify the fixes work |
0 commit comments