Skip to content

Keep runner images up to date with a weekly agentic workflow - #4362

Open
henrymercer wants to merge 4 commits into
henrymercer/runner-images-data-filefrom
henrymercer/runner-images-agentic-workflow
Open

henrymercer wants to merge 4 commits into
henrymercer/runner-images-data-filefrom
henrymercer/runner-images-agentic-workflow

Conversation

@henrymercer

Copy link
Copy Markdown
Contributor

This PR adds a weekly gh-aw agentic workflow that keeps pr-checks/runner-images.yml, the list of images that the runner-images PR check runs on, up to date. That way we add new images, and stop testing retiring ones two weeks before their brownouts start, rather than finding out when required checks fail.

The workflow's instructions are in .github/workflows/update-runner-images.md, which gh aw compile compiles to update-runner-images.lock.yml. Copilot compares the list with the runner images README and the open announcements in actions/runner-images, and opens a PR if something needs to change. Most weeks, nothing will. When GitHub announces that it's retiring an image in the list, or the agent removes one, its PR lists any references to that image in our other workflows, PR check templates and pr-checks/sync.ts, for a maintainer to update. Each image has a required check, so when the agent adds or removes images, its PR asks a maintainer to update the required checks with pr-checks/sync-checks.ts once the PR's checks have passed. It doesn't propose changes that one of its open PRs already makes.

gh-aw pushes the PR's branch and opens the PR with GITHUB_TOKEN, and can only open it if the agent's changes are limited to pr-checks/runner-images.yml. Pushes with GITHUB_TOKEN don't start workflow runs, and the PR's workflow runs wait for a maintainer to approve them. gh-aw also uses GITHUB_TOKEN for its other changes to the PR, and doesn't push the empty commit it can use to start CI, so that GH_AW_GITHUB_TOKEN and GH_AW_CI_TRIGGER_TOKEN secrets can't start the PR's runs without approval. If threat detection flags the agent's changes, or fails, the run fails without opening a PR. Detection also runs in weeks when nothing needs to change, so a detection failure fails those runs too.

The agent runs in gh-aw's sandbox and can't reach GitHub directly. Its GitHub tools hide the runner images announcements, since their authors have the CONTRIBUTOR author association, so the workflow saves the announcements, along with the README, before the agent starts.

PRs that are still open after two weeks are closed by agentics-maintenance.yml, a daily workflow that gh aw compile generates. Unchecking a PR's expires line keeps it open. The next run proposes the changes from expired PRs again if they're still needed, so a maintainer should close any PR whose changes we don't want. .github/workflows/aw.json turns off the maintenance workflow's manual operations, which we don't use. When the agent fails, gh-aw opens an issue, which the maintenance workflow closes after a week. Dependabot skips both generated workflows, since recompiling would revert its updates.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

Environments:

  • Testing/None - This change does not impact any CodeQL workflows in production.

How did/will you validate this change?

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Development/testing only - This change cannot cause any failures in production.

How will you know if something goes wrong after this change is released?

  • Other - Failed Update runner images runs, which gh-aw reports in issues.

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

henrymercer and others added 4 commits November 27, 2026 16:58
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
`aw.json` turns off the manual operations in the generated maintenance workflow, which this
repository doesn't use.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI adaptive review requested due to automatic review settings November 27, 2026 17:39
@github-actions github-actions Bot added the size/M Should be of average difficulty to review label Nov 27, 2026
@henrymercer
henrymercer added this pull request to stack #4363 November 27, 2026 17:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The saved README lacks decoded badge statuses, so rules may incorrectly add preview images or promote preview-only exclusions when the backing JSON is unavailable.

1 open issue
What changed in this PR

Adds weekly automation to keep the CodeQL Action’s CI runner-image matrix current as GitHub introduces, deprecates, or retires hosted images.

Changes:

  • Adds a Copilot workflow that compares saved upstream sources with the image list and proposes narrowly scoped PRs.
  • Configures maintainer approval, threat detection, duplicate-proposal handling, and automatic expiry of unattended PRs.
  • Integrates generated workflows with formatting, dependency updates, size reporting, and required-check tooling.
File Description
pr-checks/​runner-images.yml Adds a comment identifying the workflow that maintains the list.
pr-checks/​excluded.yml Excludes scheduled automation jobs from required-check synchronization.
.prettierignore Excludes generated workflow YAML from formatting.
.github/​workflows/​update-runner-images.md Defines the weekly agent, update rules, and PR safeguards.
.github/​workflows/​update-runner-images.lock.yml Adds the compiled runner-image update workflow.
.github/​workflows/​aw.json Disables unused maintenance operations.
.github/​workflows/​agentics-maintenance.yml Adds generated cleanup for expired automation resources.
.github/​sizeup.yml Excludes generated workflows from PR size calculations.
.github/​dependabot.yml Excludes compiler-managed workflows and action references from updates.
.github/​copilot-instructions.md Documents generated gh-aw files and their reviewable sources.
.github/​aw/​actions-lock.json Records the pinned gh-aw setup action.
.gitattributes Marks generated workflows for GitHub’s generated-file handling.

Review effort: Max (adaptive)

@henrymercer
henrymercer marked this pull request as ready for review November 27, 2026 17:57
@henrymercer
henrymercer requested a review from a team as a code owner November 27, 2026 17:57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Should be of average difficulty to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants