Expand description
GitHub Apps API client.
Three responsibilities:
- Exchange a manifest-flow
codefor permanent app credentials. - List installations of an app + map owner → installation_id.
- Add/remove repos within an existing installation (full IaC for ongoing install scope changes).
Structs§
- AppCredentials
- Permanent credentials returned by the manifest exchange.
Constants§
Functions§
- exchange_
manifest_ code - Exchange a one-time
codefrom the manifest redirect for permanent app credentials. Thecodeis single-use and expires within 1 hour. - install_
on_ repos - Add a list of repos to an existing installation. Idempotent — GitHub returns 204 even if a repo is already in the installation.
- lookup_
installation_ id - List all installations of the app and return the installation ID for the
given owner (org or user). Returns
Ok(None)if the app isn’t installed on that owner yet — caller can prompt for an install click. - rotate_
private_ key - Rotate the App’s private key. Creates a new key, writes the new credentials to the sink, then deletes the old key. Idempotent: if the second or third step fails, re-running the rotate command picks up where it left off (the API tracks both keys until one is explicitly deleted).