CI badge shows "failed" for cancelled builds
Nobody has claimed this yet.
- 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
- Have a repo with CI that auto-cancels jobs to prioritize the latest merge, and has a badge on the README.
- Open a couple PRs on the repo
- Merge one to start a job on
main - Merge another to cancel that job
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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