Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 22, 2025

This PR adds a new agentic workflow called "maintainer" that automates the process of upgrading workflows to the latest version of gh-aw. This addresses the need to keep workflows up-to-date with the latest gh-aw features, bug fixes, and breaking changes.

Note: This is an internal workflow for maintaining the agentics repository itself and is not documented for external use.

What's New

The maintainer workflow provides automated gh-aw version upgrades with intelligent error handling:

  1. Pre-configures environment: Uses GitHub Actions steps in the front matter to checkout the repository and install the gh-aw extension before the AI agent starts
  2. Fetches latest changes: Retrieves the CHANGELOG.md from the githubnext/gh-aw repository to understand new features, breaking changes, and migration instructions
  3. Recompiles workflows: Attempts to compile all workflows in the workflows/ directory with the new version
  4. Fixes compatibility issues: If compilation errors occur, analyzes them against the changelog and documentation to make necessary fixes
  5. Creates appropriate outputs:
    • On success: Opens a PR with upgraded workflows and any compatibility fixes
    • On failure: Creates an issue documenting the errors and attempted solutions

Key Features

  • Manual trigger: Uses workflow_dispatch so maintainers can run it when needed (e.g., after gh-aw releases)
  • Programmatic trigger: Supports repository_dispatch with event type maintainer for automated triggering via GitHub API or webhooks
  • Pre-configured environment: GitHub Actions steps in the front matter handle all setup (checkout and gh-aw installation) before the AI agent runs, leveraging pre-installed gh CLI
  • GitHub/edit tool enabled: Allows the agent to modify workflow files to fix compatibility issues
  • Comprehensive instructions: Step-by-step guidance ensures the agent follows best practices
  • Safe-outputs: Uses the standard read-all permissions with controlled write operations through safe-outputs

Files Added

  • workflows/maintainer.md - The workflow definition with detailed instructions for the AI agent (internal use only)

Usage

This workflow is for internal repository maintenance. Trigger it manually via workflow_dispatch when gh-aw releases a new version:

gh aw run maintainer

Or trigger it programmatically via repository_dispatch:

gh api repos/githubnext/agentics/dispatches \
  -f event_type=maintainer

The workflow will either create a PR with the upgrades or an issue if manual intervention is needed.

Original prompt

Add an agentic workflow that upgrade the workflows to the latest version of gh-aw.

  • add steps that install the latest gh aw cli extension (GitHub token needed)
  • configure the tools to run gh aw compile / version on the workflows folder
  • enable the GitHub/edit tool

Prompt the agent to fetch the interresting changes in the release from changelog.md in githubnext/gh-aw repo.

  • Then try to recompile the workflows.

  • If compilation errors occur, attempt to fix the workflows based on the gh-aw changelogs and new documentation

  • create a pull request with the changes if you were able to compile the workflows

  • create an issue if there are compilation error you are unable to run.

Call it "maintainer", workflow_dispatch


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add agentic workflow to upgrade workflows to latest gh-aw version Add maintainer workflow for automated gh-aw upgrades Oct 22, 2025
Copilot AI requested a review from pelikhan October 22, 2025 16:51
@@ -0,0 +1,86 @@
# 🔧 Maintainer Workflow
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot remove docs on maintainer, it is an internal workflow. Remove from readme.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed docs/maintainer.md and the Maintenance Workflows section from README.md in commit e7a30f4.

Copilot AI requested a review from pelikhan October 22, 2025 17:02
- 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.

@pelikhan
Copy link
Contributor

@copilot add repository dispatch support

Copy link
Contributor Author

Copilot AI commented Oct 22, 2025

@copilot add repository dispatch support

Added repository_dispatch trigger with type [maintainer] to allow programmatic triggering of the workflow. Commit a05b7bd.

Comment on lines 30 to 37
- 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
Copy link
Contributor

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

Copy link
Contributor Author

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.


- name: Install gh-aw extension
run: |
gh extension install githubnext/gh-aw || gh extension upgrade githubnext/gh-aw
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot no need for upgrade

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the upgrade fallback from the gh-aw extension installation command. Now it only runs gh extension install githubnext/gh-aw. Commit 74cedae.

Copilot AI requested a review from pelikhan October 22, 2025 17:40
@pelikhan pelikhan marked this pull request as ready for review October 22, 2025 17:40
@pelikhan pelikhan merged commit 7fd3190 into main Oct 22, 2025
0 of 2 checks passed
@pelikhan pelikhan deleted the copilot/add-agentic-workflow-upgrade branch October 22, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants