Skip to content

Commit 8c5cec9

Browse files
Fix API stability check workflow to install griffe and improve reporting
The griffe command was failing silently because griffe was not installed. This commit fixes the workflow to properly install griffe and improves error reporting. Changes: - Add explicit griffe installation step - Add continue-on-error to capture exit codes - Consolidate reporting into single step with if: always() - Handle three states: success, warning (breaking changes), and failure - Capture and report exit codes for better debugging - Add proper GitHub notices, warnings, and summaries for all states 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 536fe21 commit 8c5cec9

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

.github/workflows/api-check.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,48 @@ jobs:
3232
run: |
3333
pip install -U pip setuptools
3434
pip install -e .[test]
35+
pip install griffe
3536
3637
- name: Run griffe API check
3738
id: griffe-check
39+
continue-on-error: true
3840
run: |
41+
echo "Running griffe API stability check..."
3942
if griffe check setuptools_scm -ssrc -f github; then
4043
echo "api_check_result=success" >> $GITHUB_OUTPUT
44+
echo "exit_code=0" >> $GITHUB_OUTPUT
4145
else
46+
exit_code=$?
4247
echo "api_check_result=warning" >> $GITHUB_OUTPUT
43-
echo "API stability check detected changes but will not fail the build" >> $GITHUB_STEP_SUMMARY
48+
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
49+
exit $exit_code
4450
fi
4551
4652
- name: Report API check result
47-
if: steps.griffe-check.outputs.api_check_result == 'warning'
53+
if: always()
4854
uses: actions/github-script@v8
4955
with:
5056
script: |
51-
core.warning('API stability check detected breaking changes. Please review the API changes above.')
52-
core.summary.addRaw('⚠️ API Stability Warning: Breaking changes detected in the public API')
53-
await core.summary.write()
57+
const result = '${{ steps.griffe-check.outputs.api_check_result }}'
58+
const exitCode = '${{ steps.griffe-check.outputs.exit_code }}'
59+
60+
if (result === 'success') {
61+
core.notice('API stability check passed - no breaking changes detected')
62+
await core.summary
63+
.addHeading('✅ API Stability Check: Passed', 2)
64+
.addRaw('No breaking changes detected in the public API')
65+
.write()
66+
} else if (result === 'warning') {
67+
core.warning(`API stability check detected breaking changes (exit code: ${exitCode}). Please review the API changes above.`)
68+
await core.summary
69+
.addHeading('⚠️ API Stability Warning', 2)
70+
.addRaw('Breaking changes detected in the public API. Please review the changes reported above.')
71+
.addRaw(`\n\nExit code: ${exitCode}`)
72+
.write()
73+
} else {
74+
core.error('API stability check failed to run properly')
75+
await core.summary
76+
.addHeading('❌ API Stability Check: Failed', 2)
77+
.addRaw('The griffe check failed to execute. This may indicate griffe is not installed or there was an error.')
78+
.write()
79+
}

0 commit comments

Comments
 (0)