Add workflow to auto-close linked playground items when PRs close
Adds test-scenario-cleanup.yml workflow to automatically clean up test scenario PRs/issues in dotnet/aspire-playground when a PR closes in the main repository. Only closes items tagged with auto-close label.
Triggers
- Automatic: When any PR is closed
-
Manual: Comment
/test-scenario-cleanupon a PR
Implementation
- Searches PR body and comments for playground references via GraphQL
- Filters by
auto-closelabel before closing - Uses
GH_PLAYGROUND_TOKENsecret for playground authentication (same pattern astest-scenario.yml) - Handles both issues and PRs, skips already-closed or unlabeled items
- Posts summary comment on manual invocation
Example
PR contains:
Fixes https://github.com/dotnet/aspire-playground/issues/123
See https://github.com/dotnet/aspire-playground/pull/456
On PR close:
- Issue #123 with
auto-close→ closes automatically - PR #456 without
auto-close→ skipped
Original prompt
I want you to create a workflow that triggers when a PR is closed that gets the list of PRs and issues on the dotnet/aspire-playground repository that are linked to the PR that was just closed and closes them.
However only close the PRs and issues in the dotnet/aspire-playground repo linked where they have the "auto-close" tag applied.
In order to authenticate to the dotnet/aspire-playground repo you will need to use the GH_PLAYGROUND_TOKEN secret. Review the test-scenario.yml workflow for how it is structured around authentication and permissions.
The new workflow should be called
test-scenario-cleanup.ymland it should also be able to be triggered by the comment/test-scenario-cleanupfor when we want to clean up the PRs and issues in the playground repo.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
@radical input?