Skip to content

Commit bdbb659

Browse files
authored
chore: while awaiting-mathlib, show yellow status not red (#8471)
This PR changes the CI check when the `awaiting-mathlib` label is present. If `breaks-mathlib` is present, it shows a red cross, but if neither `breaks-mathlib` nor `builds-mathlib` is present it shows a yellow circle.
1 parent 2a1354b commit bdbb659

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/awaiting-mathlib.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,26 @@ jobs:
1414
uses: actions/github-script@v7
1515
with:
1616
script: |
17-
const { labels } = context.payload.pull_request;
18-
if (labels.some(label => label.name == "awaiting-mathlib") && !labels.some(label => label.name == "builds-mathlib")) {
19-
core.setFailed('PR is marked "awaiting-mathlib" but "builds-mathlib" label has not been applied yet by the bot');
17+
const { labels, number: prNumber } = context.payload.pull_request;
18+
const hasAwaiting = labels.some(label => label.name == "awaiting-mathlib");
19+
const hasBreaks = labels.some(label => label.name == "breaks-mathlib");
20+
const hasBuilds = labels.some(label => label.name == "builds-mathlib");
21+
22+
if (hasAwaiting && hasBreaks) {
23+
core.setFailed('PR has both "awaiting-mathlib" and "breaks-mathlib" labels.');
24+
} else if (hasAwaiting && !hasBreaks && !hasBuilds) {
25+
// Create a neutral check run (yellow circle)
26+
const octokit = github.getOctokit(process.env.GITHUB_TOKEN);
27+
await octokit.rest.checks.create({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
name: "awaiting-mathlib label check",
31+
head_sha: context.payload.pull_request.head.sha,
32+
status: "completed",
33+
conclusion: "neutral",
34+
output: {
35+
title: "Awaiting mathlib",
36+
summary: 'PR is marked "awaiting-mathlib" but neither "breaks-mathlib" nor "builds-mathlib" labels are present.'
37+
}
38+
});
2039
}

0 commit comments

Comments
 (0)