Skip to content

Commit b41eab0

Browse files
mlahargouclaude
andcommitted
fix: map cancelled check runs to failure, preserve raw conclusion
Cancelled runs (manual cancel or timeout) now map to "failure" instead of "error" so they block merge like real failures. The description field now stores the raw GitHub conclusion (cancelled, failure, timed_out, etc.) instead of the mapped state, so dashboards can differentiate between true failures and cancelled runs. Updated both the webhook and refresh paths for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 56e70da commit b41eab0

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

controllers/githubHooks.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,15 @@ const HooksController = {
155155
dbUpdated = dbManager.updateComment(comment);
156156
}
157157
} else if (event === "check_run") {
158-
const state = utils.mapCheckToStatus(
159-
body.check_run.conclusion || body.check_run.status
160-
);
158+
const conclusion = body.check_run.conclusion || body.check_run.status;
159+
const state = utils.mapCheckToStatus(conclusion);
161160

162161
const status = new Status({
163162
repo: body.repository.full_name,
164163
sha: body.check_run.head_sha,
165164
state: state,
166165
context: body.check_run.name,
167-
description: state,
166+
description: conclusion,
168167
target_url: body.check_run.html_url,
169168
started_at: body.check_run.started_at,
170169
completed_at: body.check_run.completed_at,

lib/git-manager.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@ export default {
255255
});
256256

257257
let checks = jobRuns.map(function (jobRun) {
258-
let state = utils.mapCheckToStatus(jobRun.conclusion || jobRun.status);
259-
let desc = state;
258+
let conclusion = jobRun.conclusion || jobRun.status;
259+
let state = utils.mapCheckToStatus(conclusion);
260+
let desc = conclusion;
260261
let url = jobRun.html_url;
261262
let context = jobRun.name;
262263

lib/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export default {
7777
case "skipped":
7878
return "success";
7979
case "failure":
80+
case "cancelled":
8081
return "failure";
8182
default:
8283
return "error";

0 commit comments

Comments
 (0)