actions / actions/runner

CI badge shows "failed" for cancelled builds

Open
#4,047 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the bug

If the most recent job for a runner was cancelled, the badge takes this as a "failed" job, but this doesn't really make sense. Jobs are often cancelled when multiple in-flight branches are merged. It would make more sense for the badge to always reflect the most recent, completed, non-cancelled job.

A big red "failed" at the top of a project's README can scare newcomers away from considering the project, so these temporary states could be harmful for adoption.

To Reproduce

  1. Have a repo with CI that auto-cancels jobs to prioritize the latest merge, and has a badge on the README.
  2. Open a couple PRs on the repo
  3. Merge one to start a job on main
  4. Merge another to cancel that job
  5. Observe the "failed" badge in the README as the second job is processed

Expected behavior

I expect canceled jobs to not be taken into account in the CI status.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how CI status is determined for the README badge when a job is cancelled. Reproduce the sequence described with auto-cancelled jobs on merged branches, then verify that the badge reflects the latest completed, non-cancelled job rather than the cancelled run.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.