Expand description
GitHub App auth + status write-back (D21 write-back stage, risk #15).
Credential shape: App JWT (RS256, signed by shelling out to
openssl against the operator’s PEM path — the key bytes never pass
through this process’s callers) → short-lived installation token →
commit-status POST. Permissions required of the App: Commit
statuses (read & write) plus, for the queue stage, Pull requests
(read), Checks (read), and Contents (read & write) to publish the
train branch. Nothing else.
Structs§
- Pr
- An open pull request as the queue sees it.
Enums§
- Verdict
- Aggregate CI verdict for one commit.
Functions§
- app_jwt
- Mints a short-lived (9 min) App JWT for
app_id, signing with the RS256 key atpemvia theopensslbinary. - check_
verdict - Fetches the CI verdict for
sha(needs App permission Checks: read; GitHub Actions reports through the Checks API). - default_
branch - Resolves the repo’s default branch name.
- head_
sha - Resolves the repo’s default-branch HEAD sha via the API (works on private repos the installation covers).
- installation_
token - Exchanges the App JWT for an installation token scoped to whatever repos the installation covers.
- installations_
debug - Returns the raw installations JSON (debug aid: shows the permission set each installation has actually accepted).
- list_
open_ prs - Lists open PRs on
repo(needs App permission Pull requests: read). - parse_
check_ verdict - Parses the response body of
GET /commits/{sha}/check-runsinto aVerdict. Neutral and skipped conclusions count as success; anything else non-success (failure, cancelled, timed out) fails the train. - parse_
prs - Parses the response body of
GET /repos/{repo}/pullsinto queue entries, oldest PR first (train order = submission order). - post_
status - Posts a commit status (
state: success/failure/error/pending) onowner/repo@shaundercontext.