Skip to content

fix: prechecks fail when check runs belong to another github app - #498

Open
alechartung wants to merge 2 commits into
github:mainfrom
albert-io:fix-inaccessible-check-suite-apps
Open

fix: prechecks fail when check runs belong to another github app#498
alechartung wants to merge 2 commits into
github:mainfrom
albert-io:fix-inaccessible-check-suite-apps

Conversation

@alechartung

Copy link
Copy Markdown

We ran into failed deploys after upgrading to v12, because we use an internal GitHub App to report some check runs and the workflow token cannot view that App.
v11 was fine because it didn't request checkSuite { app { databaseId } }.

🛸 github/branch-deploy v12.0.0
✅ comment body starts with trigger: .deploy
🌍 environment: dev
##[error]GraphqlResponseError: Request failed due to following response errors:
 - Resource not accessible by integration
   (x16, one per check run owned by the App)
    at prechecks (src/functions/prechecks.ts:191:1)

This fixes it by recovering the partial response when every error is FORBIDDEN and scoped to checkSuite App data.
Everything else still throws as before.

Includes tests and the regenerated dist/ bundle.

Verified by pointing our workflows at this commit and running branch deploys.

…e by the token

The v12 prechecks GraphQL queries request checkSuite { app { databaseId } }
for every check run. When the workflow token cannot view the GitHub App that
owns a check suite (for example, the Actions GITHUB_TOKEN reading check runs
created by another App installed on the repository), GitHub returns per-node
FORBIDDEN errors alongside an otherwise valid response, and octokit throws
away the usable partial data - failing every deployment on such repositories.

Recover the partial response when every reported error is that App access
failure. The nulled App identity is already handled as an optional
disambiguation hint by latestCheckResults.

@GrantBirki GrantBirki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking this down! Recovering the partial response makes sense here. Two non-blocking suggestions:

  1. Could we match the expected checkSuite.app or checkSuite.app.databaseId paths instead of accepting any path that contains checkSuite? I don't see a bypass in the current query, but this keeps a future field under checkSuite from accidentally being treated as optional App metadata.
  2. Could we add a few negative cases through the recovery helper as well? A failed required check, mixed App-access and unrelated errors, a null check node, and duplicate policy-relevant checks with app: null would be useful. Please include a later-page case too. The existing filtering tests cover much of this separately; these cases would help keep missing App metadata from allowing a failing or unverifiable check to pass.

@alechartung

alechartung commented Aug 20, 2026

Copy link
Copy Markdown
Author

Added a commit for those suggestions.

@alechartung
alechartung requested a review from GrantBirki August 20, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants