[PR #918] [MERGED] CI: cancel a pull request's unfinished checks when it closes #2913

Closed
opened 2026-11-02 16:00:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/918
Author: @ludovic111
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @ludovic111

Base: main ← Head: ci/cancel-on-close


📝 Commits (1)

  • 41bd91f CI: cancel a pull request's unfinished checks when it closes

📊 Changes

1 file changed (+27 additions, -0 deletions)

View changed files

➕ .github/workflows/cancel-on-close.yml (+27 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

A contributor asked on Discord for this: merged or closed pull requests kept their queued runs, which held the self-hosted runners until someone cancelled them by hand. Today 19 such runs had to be cancelled.

What

New workflow cancel-on-close.yml: when a pull request closes (merged or not), it cancels that pull request's queued, waiting and running pull_request runs.

  • It uses pull_request_target, so the token can cancel runs of pull requests from forks too. It checks out nothing and runs no code from the pull request; only actions: write is granted.
  • It matches both the branch and the head commit, so a fork branch with the same name as another pull request's branch doesn't cancel that pull request's runs. Runs for older pushes are already cancelled by ci.yml's concurrency group.
  • It runs on ubuntu-latest (free for this public repo), so it doesn't wait behind the self-hosted queue it is clearing.

Check

YAML parses. The workflow can only be exercised once it's on main: the first pull request closed afterwards shows it.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/918 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `ci/cancel-on-close` --- ### 📝 Commits (1) - [`41bd91f`](https://github.com/horizon-rust/horizon/commit/41bd91f295dc5f1d57f371089c105a4f417cc0e7) CI: cancel a pull request's unfinished checks when it closes ### 📊 Changes **1 file changed** (+27 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/cancel-on-close.yml` (+27 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. A contributor asked on Discord for this: merged or closed pull requests kept their queued runs, which held the self-hosted runners until someone cancelled them by hand. Today 19 such runs had to be cancelled. ## What New workflow `cancel-on-close.yml`: when a pull request closes (merged or not), it cancels that pull request's queued, waiting and running `pull_request` runs. - It uses `pull_request_target`, so the token can cancel runs of pull requests from forks too. It checks out nothing and runs no code from the pull request; only `actions: write` is granted. - It matches both the branch and the head commit, so a fork branch with the same name as another pull request's branch doesn't cancel that pull request's runs. Runs for older pushes are already cancelled by ci.yml's concurrency group. - It runs on `ubuntu-latest` (free for this public repo), so it doesn't wait behind the self-hosted queue it is clearing. ## Check YAML parses. The workflow can only be exercised once it's on main: the first pull request closed afterwards shows it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:00:03 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2913
No description provided.