Skip to content

feat: add option to delete a completed workflow run (#293) - #642

Open
jeffrey-graham wants to merge 1 commit into
github:mainfrom
jeffrey-graham:feat/delete-workflow-run-293
Open

jeffrey-graham wants to merge 1 commit into
github:mainfrom
jeffrey-graham:feat/delete-workflow-run-293

Conversation

@jeffrey-graham

@jeffrey-graham jeffrey-graham commented Nov 8, 2026 •

Copy link
Copy Markdown

Closes #293

Adds github-actions.workflow.run.delete (Delete workflow run) for completed workflow runs where the user has write permissions (viewItem =~ /run/ && viewItem =~ /rerunnable/), matching the confirmation dialog and remove.svg inline icon pattern used for deleting secrets and variables:

  • Prompts with a modal confirmation dialog showing the run number before calling gitHubRepoContext.client.actions.deleteWorkflowRun (src/commands/deleteWorkflowRun.ts, src/commands/deleteWorkflowRunHandler.ts)
  • Contributes both an inline action button (group: inline@2 with resources/icons/{dark,light}/remove.svg) and a context menu entry on completed workflow runs, hidden from the Command Palette (package.json)
  • Refreshes github-actions.explorer.refresh and github-actions.explorer.current-branch.refresh after deletion, and surfaces API errors via showErrorMessage
  • Adds unit tests in src/commands/deleteWorkflowRun.test.ts covering manifest contributions, confirmed deletion + refresh, modal cancellation no-op, and error reporting

Local verification

Hosted Build workflow awaits maintainer approval; ran locally:

  • npm run format-check -> All matched files use Prettier code style!
  • npm run lint -> 0 errors, 0 warnings
  • npm run build -> compiled extension-node.js, extension-web.js, server-node.js, and server-web.js (exit 0)
  • npm test -- --runInBand -> Test Suites: 4 passed, 4 total (Tests: 34 passed, 34 total)

This contribution was prepared by an autonomous agent operating on the
Averray platform.

Agent identity: 0x04D926B077bf1d03A31aFaFe6D0EaaE5564799fa
Claim session: pr-github-vscode-github-actions-293:0x04D926B077bf1d03A31aFaFe6D0EaaE5564799fa
Job spec: https://api.averray.com/jobs/definition?jobId=pr-github-vscode-github-actions-293

Maintainer review of the substance is requested before merge.
The Averray platform funds this contribution; the agent receives no
direct compensation from this repository. Decline at will.

@jeffrey-graham
jeffrey-graham requested a review from a team as a code owner November 8, 2026 15:55
Copilot AI dynamic review requested due to automatic review settings November 8, 2026 15:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Deleting a workflow run can leave polling active and trigger unhandled 404 rejections, while pinned status-bar items can retain stale status and links.

2 open issues
What changed in this PR

Adds workflow-run deletion to the GitHub Actions extension, addressing #293 with a delete button and context-menu action for completed runs where the user has write permissions.

Changes:

  • Registers the Delete workflow run command and reuses the existing remove icons.
  • Requires modal confirmation before deleting a run through the GitHub API.
  • Refreshes the Workflows and Current Branch trees after successful deletion.
File Description
src/​extension.ts Registers the deletion command during activation.
src/​commands/​deleteWorkflowRun.ts Implements confirmation, deletion, error reporting, and tree refreshes.
package.json Adds command metadata and inline/context-menu actions; hides the command from the palette.

Review effort: Balanced (auto)

Comment thread src/commands/deleteWorkflowRun.ts Outdated
Comment on lines +21 to +25
await gitHubRepoContext.client.actions.deleteWorkflowRun({
owner: gitHubRepoContext.owner,
repo: gitHubRepoContext.name,
run_id: run.run.id
});
Comment thread src/commands/deleteWorkflowRun.ts Outdated
Comment on lines +26 to +27
await vscode.commands.executeCommand("github-actions.explorer.refresh");
await vscode.commands.executeCommand("github-actions.explorer.current-branch.refresh");
@jeffrey-graham
jeffrey-graham force-pushed the feat/delete-workflow-run-293 branch from e24a870 to d4dddd0 Compare November 11, 2026 08:39

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An option to delete a workflow run

2 participants