Documentation
¶
Overview ¶
Package githubactions implements buildrunner.BuildRunner backed by GitHub Actions workflow_dispatch.
The runner dispatches a trusted workflow and passes SubmitQueue's base/head change URIs as workflow inputs. Trigger returns the GitHub workflow run ID; Status and Cancel use that ID to call GitHub's workflow-run endpoints.
Index ¶
Constants ¶
View Source
const ( // InputKeyBaseURIs carries the JSON-encoded ordered list of change URIs // from dependency batches. InputKeyBaseURIs = "sq_base_uris" // InputKeyHeadURIs carries the JSON-encoded ordered list of change URIs // from the batch under test. InputKeyHeadURIs = "sq_head_uris" // InputKeyQueue carries the SubmitQueue queue name. InputKeyQueue = "sq_queue" // InputKeyMetadata carries caller-supplied BuildMetadata as JSON. InputKeyMetadata = "sq_metadata" )
Variables ¶
This section is empty.
Functions ¶
func NewBuildRunner ¶
func NewBuildRunner(params Params) (buildrunner.BuildRunner, error)
NewBuildRunner constructs a GitHub Actions-backed BuildRunner bound to one repository/workflow and one queue config.
Types ¶
type Params ¶
type Params struct {
// Config holds the per-queue identity for this BuildRunner.
Config buildrunner.Config
// HTTPClient is a pre-configured GitHub API client. The caller is responsible
// for base URL resolution (e.g. via platform/http.BaseURLTransport) and auth.
// The token needs actions:write to dispatch/cancel workflows and actions:read
// to poll status.
HTTPClient *http.Client
// Resolver resolves a batch's changes (base and head batches).
Resolver changeset.Resolver
// Logger is the structured logger.
Logger *zap.SugaredLogger
// Owner is the repository owner or organization, for example "uber".
Owner string
// Repo is the repository name, for example "submitqueue".
Repo string
// WorkflowID is the workflow file name or numeric workflow ID accepted by
// the GitHub Actions API, for example "submitqueue-ci.yml".
WorkflowID string
// Ref is the branch, tag, or SHA where the trusted workflow is read from.
// Defaults to "main".
Ref string
// ExtraInputs are copied into every workflow_dispatch request. Reserved
// sq_* inputs managed by this package override conflicting keys.
ExtraInputs map[string]string
}
Params holds the dependencies and GitHub workflow identity for a GitHub Actions BuildRunner.
Click to show internal directories.
Click to hide internal directories.