fix: fall back to workflow scanning when code scanning API returns 403#2311
Merged
Marfuen merged 2 commits intotrycompai:mainfrom Mar 16, 2026
Merged
Conversation
The getCodeScanningStatus function previously returned early with ghas-required or permission-denied when the code-scanning API returned 403, skipping workflow file scanning entirely. This prevented detection of third-party SAST tools (Semgrep, Snyk, Trivy) that upload SARIF results via github/codeql-action/upload-sarif. The code-scanning API requires GHAS for private repos, but reading workflow file contents only requires contents:read — these are independent permission scopes. A 403 on the API should not prevent checking for code scanning workflows. Now the 403 handler sets a flag instead of returning early, always falls through to workflow scanning, and only returns the appropriate error status if no workflows are found either.
|
@kline7 is attempting to deploy a commit to the Comp AI Team on Vercel. A member of the Team first needs to authorize it. |
Marfuen
approved these changes
Mar 16, 2026
claudfuen
pushed a commit
that referenced
this pull request
Mar 16, 2026
# [3.7.0](v3.6.0...v3.7.0) (2026-03-16) ### Bug Fixes * **auth:** add rate limiting for admin endpoints ([f81148b](f81148b)) * fall back to workflow scanning when code scanning API returns 403 ([#2311](#2311)) ([5a5fe85](5a5fe85)) ### Features * **admin-organizations:** add admin dashboard ([e5318ec](e5318ec))
Contributor
|
🎉 This PR is included in version 3.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
getCodeScanningStatusfunction insanitized-inputs.tsreturns early withghas-requiredorpermission-deniedwhen the GitHub code-scanning API returns HTTP 403. This skips workflow file scanning entirely, preventing detection of third-party SAST tools (Semgrep, Snyk, Trivy, etc.) that upload SARIF results viagithub/codeql-action/upload-sarif.Impact: Private repos without GitHub Advanced Security (GHAS) can never pass the code scanning check, even if they have properly configured SAST workflows using third-party tools.
Root Cause
The code-scanning default-setup API requires GHAS (or
security_eventspermission) for private repos, but reading workflow file contents via the tree/contents API only requirescontents:read. These are independent permission scopes. A 403 on the code-scanning API does not mean workflow files are inaccessible.The comment on the original code explicitly says "Return early without checking workflows since we can't verify they're actually running" — but this is incorrect. Workflow files in the repo tree are verifiable evidence of code scanning configuration.
Fix
returnstatements in the 403 handler with a boolean flag (apiGot403)findCodeScanningWorkflows()regardless of API responseghas-required,permission-denied, ornot-configured)Changes
Single file:
packages/integration-platform/src/manifests/github/checks/sanitized-inputs.tsTesting
No test infrastructure exists for integration checks (CONTRIBUTING.md testing section says "Coming soon"). The change is minimal and the logic is straightforward: flag instead of early return, deferred status determination.