Skip to content

Commit 32fb396

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 08b1c17 commit 32fb396

File tree

2 files changed

+36
-1
lines changed

2 files changed

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

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)