aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Add workflow to auto-close linked playground items when PRs close

Open Copilot opened this issue 4 months ago • 1 comments

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-cleanup on a PR

Implementation

  • Searches PR body and comments for playground references via GraphQL
  • Filters by auto-close label before closing
  • Uses GH_PLAYGROUND_TOKEN secret for playground authentication (same pattern as test-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.yml and it should also be able to be triggered by the comment /test-scenario-cleanup for 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.

Copilot avatar Oct 28 '25 08:10 Copilot

@radical input?

mitchdenny avatar Oct 28 '25 11:10 mitchdenny