File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments