Documentation
¶
Overview ¶
Package internal implements the workflow-plugin-github plugin, providing GitHub webhook handling and GitHub Actions workflow management.
Index ¶
- Variables
- func NewGitHubPlugin() sdk.PluginProvider
- func NewGitHubRunnerProviderHTTPHandler(name string, raw map[string]any) (http.Handler, error)
- type AppTransport
- type CheckRun
- type CheckRunOutput
- type CreateCheckRunRequest
- type GitEvent
- type GitHubClient
- type GitHubRunnerClient
- type GitHubRunnerRegistrationToken
- type SDKClient
- type WorkflowRun
Constants ¶
This section is empty.
Variables ¶
var Version = "0.0.0"
Version is set at build time via -ldflags "-X github.com/GoCodeAlone/workflow-plugin-github/internal.Version=X.Y.Z"
Functions ¶
func NewGitHubPlugin ¶
func NewGitHubPlugin() sdk.PluginProvider
NewGitHubPlugin returns a new githubPlugin instance.
Types ¶
type AppTransport ¶ added in v1.0.2
type AppTransport struct {
// contains filtered or unexported fields
}
AppTransport implements http.RoundTripper for GitHub App authentication, automatically refreshing the installation token as needed.
func NewAppTransport ¶ added in v1.0.2
func NewAppTransport(mod *githubAppModule) *AppTransport
NewAppTransport creates an http.RoundTripper that uses App installation tokens.
type CheckRun ¶
type CheckRun struct {
ID int64 `json:"id"`
HTMLURL string `json:"html_url"`
Status string `json:"status"`
}
CheckRun represents a GitHub Check Run response.
type CheckRunOutput ¶
CheckRunOutput holds the title and summary for a check run.
type CreateCheckRunRequest ¶
type CreateCheckRunRequest struct {
Name string `json:"name"`
HeadSHA string `json:"head_sha"`
Status string `json:"status"`
Conclusion string `json:"conclusion,omitempty"`
Output *CheckRunOutput `json:"output,omitempty"`
}
CreateCheckRunRequest holds parameters for creating a GitHub Check Run.
type GitEvent ¶
type GitEvent struct {
Provider string `json:"provider"` // "github"
EventType string `json:"event_type"` // "push", "pull_request", etc.
Repository string `json:"repository"` // "owner/repo"
Branch string `json:"branch"` // "main", "feature/xyz"
Commit string `json:"commit"` // SHA
Author string `json:"author"` // username
Message string `json:"message"` // commit message or PR title
URL string `json:"url"` // link to commit/PR
RawPayload json.RawMessage `json:"raw_payload"` // original payload
Timestamp time.Time `json:"timestamp"`
}
GitEvent is the normalized event schema published to the message broker.
type GitHubClient ¶
type GitHubClient interface {
TriggerWorkflow(ctx context.Context, owner, repo, workflow, ref string, inputs map[string]string, token string) error
GetWorkflowRun(ctx context.Context, owner, repo string, runID int64, token string) (*WorkflowRun, error)
CreateCheckRun(ctx context.Context, owner, repo string, req *CreateCheckRunRequest, token string) (*CheckRun, error)
}
GitHubClient is the interface for interacting with the GitHub API. It is defined as an interface so tests can inject a mock.
type GitHubRunnerClient ¶ added in v1.0.3
type GitHubRunnerRegistrationToken ¶ added in v1.0.3
type SDKClient ¶ added in v1.0.2
SDKClient wraps the go-github client with auth support.
func NewSDKClient ¶ added in v1.0.2
NewSDKClient creates a client authenticated with a personal access token.
func NewSDKClientFromTransport ¶ added in v1.0.2
func NewSDKClientFromTransport(rt http.RoundTripper) *SDKClient
NewSDKClientFromTransport creates a client from an http.RoundTripper (for GitHub App auth).
Source Files
¶
- contracts.go
- github_client.go
- github_sdk_client.go
- module_github_app.go
- module_runner_provider.go
- module_webhook.go
- plugin.go
- resolve.go
- schemas.go
- step_action_status.go
- step_action_trigger.go
- step_compute_gateway.go
- step_create_check.go
- step_deployment_create.go
- step_graphql.go
- step_issue_close.go
- step_issue_create.go
- step_issue_label.go
- step_pr_comment.go
- step_pr_create.go
- step_pr_merge.go
- step_pr_review.go
- step_release_create.go
- step_release_upload.go
- step_repo_dispatch.go
- step_secret_set.go