Skip to content

Commit 54a6c80

Browse files
frostebiteclaude
andcommitted
ci: mark failed macOS builds as neutral instead of failure
Use the Checks API to flip failed macOS build conclusions to neutral (gray dash) so unstable builds don't show red X marks on PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c08d13e commit 54a6c80

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/build-tests-mac.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ concurrency:
88
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
99
cancel-in-progress: true
1010

11+
permissions:
12+
checks: write
13+
1114
jobs:
1215
buildForAllPlatformsMacOS:
1316
name: ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
@@ -88,3 +91,35 @@ jobs:
8891
Build Profile' || '' }}
8992
path: build
9093
retention-days: 14
94+
95+
markUnstableBuilds:
96+
name: Mark unstable macOS builds
97+
needs: buildForAllPlatformsMacOS
98+
if: always()
99+
runs-on: ubuntu-latest
100+
steps:
101+
- uses: actions/github-script@v7
102+
with:
103+
script: |
104+
const { data: checkRuns } = await github.rest.checks.listForRef({
105+
owner: context.repo.owner,
106+
repo: context.repo.repo,
107+
ref: context.sha,
108+
per_page: 100,
109+
});
110+
111+
for (const run of checkRuns.check_runs) {
112+
if (run.conclusion !== 'failure' || run.app?.slug !== 'github-actions') continue;
113+
if (!run.name.includes('StandaloneOSX') && !run.name.includes('iOS')) continue;
114+
115+
await github.rest.checks.update({
116+
owner: context.repo.owner,
117+
repo: context.repo.repo,
118+
check_run_id: run.id,
119+
conclusion: 'neutral',
120+
output: {
121+
title: `${run.name} (unstable)`,
122+
summary: 'This macOS build is unstable and its failure does not block merging.',
123+
},
124+
});
125+
}

0 commit comments

Comments
 (0)