sweep: post commit statuses via our own GitHub App#45
Merged
Conversation
The exe.dev integration's token is statuses:read-only, so GITHUB_STATUS 403s on every post through gh. New optional GITHUB_STATUS_APP_ID + GITHUB_STATUS_APP_KEY mint short-lived installation tokens from our own App's key (RS256 JWT, node:crypto, curl with the bearer on stdin) and post statuses directly to api.github.com; gh stays the fallback and the transport for everything else.
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.
The exe.dev integration token is
statuses: read-only, so enablingGITHUB_STATUS403s on every post (Resource not accessible by integration) — which is why it's been forced off on the VMs and open findings are invisible in the PR checks row.This adds an optional own-App transport for statuses only:
GITHUB_STATUS_APP_ID+GITHUB_STATUS_APP_KEY(path to the App's .pem) inconfig.envappJwtbuilds the RS256 App JWT with node:crypto (no new deps); installation token minted withstatuses: writeonly and cached 55min instate/gh-app-token.json, so the every-minute cron mints ~once an hourghis pinned to the exe.dev proxy viaGH_HOST); the bearer rides curl's stdin config, never argvgh api); any failure degrades to a logged skip, same as a gh outageSetup: create a GitHub App with Commit statuses R/W, install on the repo, drop the .pem on the VM, set the two keys.