mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-19 00:56:16 +00:00
fix: resolve notify workflow failures
- Remove exit 1 from status check to prevent workflow failure - Add proper GitHub permissions (statuses: write, contents: read) - Add error handling for commit status API calls - Add detailed logging to show which specific CI jobs failed - Ensure workflow completes successfully even when CI checks fail Fixes the 403 HTTP error and improves debugging visibility.
This commit is contained in:
+25
-11
@@ -220,6 +220,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test, lint, build, security, docs]
|
||||
if: always()
|
||||
permissions:
|
||||
statuses: write
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Check overall status
|
||||
@@ -233,8 +236,12 @@ jobs:
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "❌ Some CI checks failed"
|
||||
echo "Test: ${{ needs.test.result }}"
|
||||
echo "Lint: ${{ needs.lint.result }}"
|
||||
echo "Build: ${{ needs.build.result }}"
|
||||
echo "Security: ${{ needs.security.result }}"
|
||||
echo "Docs: ${{ needs.docs.result }}"
|
||||
echo "status=failure" >> $GITHUB_OUTPUT
|
||||
exit 1
|
||||
fi
|
||||
id: status
|
||||
|
||||
@@ -243,14 +250,21 @@ jobs:
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
const state = '${{ steps.status.outputs.status }}' === 'success' ? 'success' : 'failure';
|
||||
const description = state === 'success' ? 'All checks passed' : 'Some checks failed';
|
||||
try {
|
||||
const state = '${{ steps.status.outputs.status }}' === 'success' ? 'success' : 'failure';
|
||||
const description = state === 'success' ? 'All checks passed' : 'Some checks failed';
|
||||
|
||||
github.rest.repos.createCommitStatus({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
sha: context.sha,
|
||||
state: state,
|
||||
description: description,
|
||||
context: 'CI Pipeline'
|
||||
});
|
||||
await github.rest.repos.createCommitStatus({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
sha: context.sha,
|
||||
state: state,
|
||||
description: description,
|
||||
context: 'CI Pipeline'
|
||||
});
|
||||
|
||||
console.log(`✅ Successfully updated commit status to: ${state}`);
|
||||
} catch (error) {
|
||||
console.log(`⚠️ Failed to update commit status: ${error.message}`);
|
||||
// Don't fail the workflow if status update fails
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user