feat(workflows): allow update-awf-version to close superseded PRs#590
Merged
Conversation
Adds close-pull-request safe-output with required-title-prefix matching the title-prefix on create-pull-request so the agent can only close PRs it is allowed to open. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allows the
update-awf-versionagent to close its own superseded pull requests, while restricting closures to PRs that match the exact title pattern this workflow is allowed to open.Why
The version-updater workflow opens a new PR every time
AWF_VERSION,COPILOT_CLI_VERSION,MCPG_VERSION, orecosystem_domains.jsonfalls behind upstream. Because the PR title includes the version number, an older outdated PR cannot be detected by exact-title duplicate checking and accumulates until a maintainer closes it manually. The agent should be allowed to clean these up — but only its own PRs.Approach
Restriction is enforced at two layers:
Safe-output layer (gh-aw enforced). Added a
title-prefix: "chore(deps): "tocreate-pull-requestso every PR the workflow opens is namespaced. Added a newclose-pull-requestsafe output withrequired-title-prefix: "chore(deps): ",target: "*",max: 10. gh-aw will reject any close request whose target PR title does not start withchore(deps):.Agent-instruction layer. Step 3 of the prompt now tells the agent to look for open PRs starting with the item-specific sub-prefix (e.g.
chore(deps): update AWF_VERSION to), keep any exact match for the latest version, and close older outdated ones viaclose-pull-request. Explicit guidance forbids crossing item boundaries — a staleMCPG_VERSIONPR is not closable from theAWF_VERSIONstep, even though both share the broaderchore(deps):namespace.PR titles in the markdown body were updated to drop the redundant
chore:(gh-aw auto-prependschore(deps):), producing clean conventional-commits titles likechore(deps): update AWF_VERSION to 0.24.0.Files changed
.github/workflows/update-awf-version.md— addedclose-pull-request, addedtitle-prefixoncreate-pull-request, rewrote step 3 and updated PR title templates.github/workflows/update-awf-version.lock.yml— recompiled.github/aw/actions-lock.json— incidental lockfile refresh fromgh aw compile(gh-aw-actions/setupv0.71.5 → v0.72.1)Verification