imbi-plugin-github
GitHub plugin for Imbi. A single plugin — slug github — backs every
GitHub Integration; the integration-level flavor option selects
github.com (github), GitHub Enterprise Cloud (ghec), or GitHub
Enterprise Server (ghes), and host names the tenant or appliance.
Capabilities
| Kind | Handler |
|---|---|
identity |
GitHubIdentity |
deployment |
GitHubDeployment |
lifecycle |
GitHubLifecycle |
webhook-actions |
GitHubWebhookActions |
commit-sync |
GitHubCommitSync |
pr-sync |
GitHubPullRequestSync |
analysis |
GitHubDoctor |
Identity
Implements the OAuth App flow. The access token returned by the OAuth
grant is passed straight to GitHub APIs as a Bearer token, so
materialize() is a no-op.
Deployment
Drives the GitHub Deployments API (POST /repos/{owner}/{repo}/deployments)
plus tag and release creation. Promote behaviour is inferred from the
ref shape by the host (semver → trigger Deployment, raw SHA → cut tag
- Release). Per-env workflow inputs ride on the
USES_PLUGINedge asenv_payloadsand arrive onPluginContext.environment_config.
Lifecycle
Reacts to project archive / unarchive by archiving the matching repo via
PATCH /repos/{owner}/{repo} with {"archived": true|false}. When the
archive_target_org option is set, archive also transfers the repo to
that org first via POST /repos/{owner}/{repo}/transfer — useful for
moving sunset projects into a dedicated "archive" org so they no longer
crowd primary-org searches.
GitHub refuses to transfer archived repos, so an already-archived source
is briefly unarchived, transferred, and re-archived at the destination.
On unarchive the plugin only flips archived back to false at the
repo's current location — it does not transfer back to the original
org.
Archiving requires admin scope on the repo; transferring additionally requires admin permission on the target organization.
Webhook actions (commit / tag / PR sync)
The webhook-actions capability exposes the actions the gateway
dispatches from webhook deliveries. A WebhookRule.handler is
"<plugin_slug>#<action_name>", and the slug is the plugin slug —
github — not the capability kind:
| Action | Handler | Records into ClickHouse |
|---|---|---|
sync_commits |
github#sync_commits |
commits |
sync_tags |
github#sync_tags |
tags |
sync_pull_requests |
github#sync_pull_requests |
pull_requests |
sync_commits and sync_tags are dispatched from push deliveries;
sync_pull_requests from pull_request deliveries.
sync_commits fetches the full set of commits in a push via the compare
API (paginated, so it isn't capped by the 20-commit inline payload limit);
sync_tags records the pushed tag and, with reconcile_all, the repo's
full tag list. Branch/tag gating is the rule's CEL filter_expression,
which evaluates against the recorded event — the webhook body is under
payload (e.g. payload.ref == "refs/heads/main",
payload.ref.startsWith("refs/tags/")). The API
flavor (github.com / GHEC / GHES) is resolved at runtime — explicit
api_base_url, else a connected GitHub plugin on the same service, else
the service endpoint, else the payload's repository.url.
Unlike identity/deployment/lifecycle (which act as the OAuth user), commit-sync runs without an actor and authenticates with a service credential in one of two modes, resolved per call:
- PAT — a static
access_token. - GitHub App —
app_id+private_key; the plugin signs an App JWT and mints a short-lived installation token (cached process-wide until shortly before it expires), so no static, expiring token is stored.installation_idis optional — when unset it is discovered from the pushed repository (GET /repos/{owner}/{repo}/installation). The App needs Contents: Read-only.
Pull request history sync
GitHubPullRequestSync.sync_all_history is the on-demand pr-sync
backfill. It walks GET /repos/{owner}/{repo}/pulls?state=all (up to 100
pages of 100) and publishes a pull_requests row for every PR.
After a complete walk it reconciles: it deletes the project's open rows
on the synced host whose pr_id GitHub did not list, so a PR filed under
the project from another repository does not stay open forever. It
selects those rows first, logs their URLs, and deletes exactly those
pr_ids; a sync with nothing stale issues no delete.
It never deletes:
- closed or merged rows, so PR history survives a move to a new repository;
- rows on another host, from a second
pr-syncIntegration; - rows recorded less than five minutes before the sync started, which covers webhook rows written during the sync and clock skew between hosts;
- the row of a PR GitHub lists but is too malformed to record.
The reconcile is skipped when the listing may be incomplete (a 404 on any
page, a next link it cannot follow, or the page cap), when the GitHub App
is not installed for the repository, and when the repository did not come
from the project's repository link (the Integration's link key or
github-repository). It runs even if the publish failed, and a
ClickHouse failure is logged and does not fail the sync.
Integration options
Asked once per Integration and delivered to every capability on
PluginContext.integration_options:
| Option | Required | Description |
|---|---|---|
flavor |
yes | github, ghec, or ghes. |
host |
GHEC/GHES | Tenant or appliance host (e.g. tenant.ghe.com, github.example.com). |
Capability options
Scoped to one capability and delivered on
PluginContext.capability_options:
| Capability | Option | Description |
|---|---|---|
identity |
default_scopes |
Space-separated OAuth scopes (default: read:user user:email repo workflow). |
lifecycle |
archive_target_org |
Org to transfer repos to before archiving; blank archives in place. |
lifecycle |
create_org |
Default org for repo creation when no org_mapping entry matches. |
lifecycle |
org_mapping |
Per-project-type-slug org overrides; the first match wins over create_org. |
Credentials
One credential store per Integration — every capability receives the same decrypted blob. All fields are individually optional and validated per call, so an identity-only or App-only Integration is valid:
| Field | Used by | Description |
|---|---|---|
access_token |
service (PAT mode) | Static personal/service token. |
app_id |
service (App mode) | GitHub App identifier. |
private_key |
service (App mode) | App private key — raw PEM or base64-encoded PEM. |
installation_id |
service (App mode) | Optional; discovered from the repo when unset. |
client_id |
identity |
OAuth App client id. |
client_secret |
identity |
OAuth App client secret. |
For commit-sync, pr-sync, and deployment provide either
access_token or app_id + private_key. lifecycle acts as the
user and takes only access_token (or token) — it does not fall back
to GitHub App credentials.
License
BSD-3-Clause.
Metadata
Release files for imbi-plugin-github 2.44.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| imbi_plugin_github-2.44.0.tar.gz | 171.9 kB | With provenance | Details for imbi_plugin_github-2.44.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| imbi_plugin_github-2.44.0-py3-none-any.whl | Python 3 | none | any | Details for imbi_plugin_github-2.44.0-py3-none-any.whl |
Total release size: 283.5 kB
Release files / imbi_plugin_github-2.44.0.tar.gz
| Download URL | imbi_plugin_github-2.44.0.tar.gz |
|---|---|
| Size | 171.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84fb095d00afe70a902b7987c25bbc70c0307521d44bcbca8a0d28a91ec95785
|
|
BLAKE2b-256 checksum How to use checksums |
6e7ed3f0909f2adcc10affa9181642f4e7b0c2341e5dbf237d90da09916df49e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logRelease files / imbi_plugin_github-2.44.0-py3-none-any.whl
| Download URL | imbi_plugin_github-2.44.0-py3-none-any.whl |
|---|---|
| Size | 111.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b0ea998d3a95a7660fbe5739df3b3a3feffafb6f563e4501b6be39ad69b0b81
|
|
BLAKE2b-256 checksum How to use checksums |
c04f6b70bdbe4f46e4128b3a0e3f44f4a5d6054b9aab7fb22f31eced831e819b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logSecurity for imbi-plugin-github 2.44.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for imbi_plugin_github-2.44.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.