Documentation
¶
Overview ¶
Package ghpush applies an agent's changeset to GitHub through the Git Data API. The agent works in a network-isolated pod and hands its commit back as structured file contents (envelope.Changeset); the controller replays that changeset as blob → tree → commit → ref calls with a short-lived, single-repository write token. This is the only place a push credential exists. No git binary and no clone are involved, so the push costs the same on a ten-commit repository as on one with a decade of history.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pusher ¶
type Pusher struct {
// contains filtered or unexported fields
}
Pusher pushes agent changesets through the GitHub API.
func New ¶
New builds a Pusher. baseURL overrides the GitHub API endpoint (GHES, tests); empty means github.com. opts (e.g. ghclient.WithProxy) shape the per-push client.
func (*Pusher) Push ¶
func (p *Pusher) Push(ctx context.Context, repo ghclient.Repo, token, branch string, cs *envelope.Changeset, commit string) (string, error)
Push creates one commit from the changeset on top of its base SHA and points branch at it, returning the commit SHA. commit, when set, is the commit an earlier attempt created for the same changeset: it is reused if the forge still has it. A failure to point the branch is a *ghclient.PushError carrying the commit. The short-lived write token lives only for this call and is never persisted.