{"modulePath":"github.com/GoCodeAlone/workflow-plugin-github","version":"v1.0.34","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package internal\n\nPackage internal implements the workflow-plugin-github plugin, providing GitHub webhook handling and GitHub Actions workflow management.\n\n## Variables\n\n```go\nvar ErrEphemeralRunnerCapabilityUnsupported = errors.New(\"ephemeral runner capability unsupported\")\n```\n\n```go\nvar Version = \"0.0.0\"\n```\nVersion is set at build time via -ldflags \"-X github.com/GoCodeAlone/workflow-plugin-github/internal.Version=X.Y.Z\"\n\n## Functions\n\n```go\nfunc NewCLI() sdk.CLIProvider\n```\n\n```go\nfunc NewGitHubPlugin() sdk.PluginProvider\n```\nNewGitHubPlugin returns a new githubPlugin instance.\n\n```go\nfunc NewGitHubRunnerProviderHTTPHandler(name string, raw map[string]any) (http.Handler, error)\n```\n\n## Types\n\n```go\ntype AppTransport struct {\n\t// contains filtered or unexported fields\n}\n```\nAppTransport implements http.RoundTripper for GitHub App authentication, automatically refreshing the installation token as needed.\n\n```go\nfunc NewAppTransport(mod *githubAppModule) *AppTransport\n```\nNewAppTransport creates an http.RoundTripper that uses App installation tokens.\n\n```go\nfunc (t *AppTransport) RoundTrip(req *http.Request) (*http.Response, error)\n```\nRoundTrip injects the installation token into each request.\n\n```go\ntype EphemeralRunnerJob struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewEphemeralRunnerJob(driver EphemeralRunnerJobDriver) *EphemeralRunnerJob\n```\n\n```go\nfunc (j *EphemeralRunnerJob) Run(ctx context.Context, req EphemeralRunnerJobRequest) (EphemeralRunnerJobResult, error)\n```\n\n```go\ntype EphemeralRunnerJobDriver interface {\n\tRunGitHubJob(ctx context.Context, mode EphemeralRunnerJobMode, spec EphemeralRunnerJobSpec) (EphemeralRunnerJobResult, error)\n\tRemoveOrgRunner(ctx context.Context, organization string, runnerID int64) error\n}\n```\n\n```go\ntype EphemeralRunnerJobMode string\n```\n\n```go\nconst (\n\tEphemeralRunnerJobModeDispatchThenWait EphemeralRunnerJobMode = \"dispatch_then_wait\"\n\tEphemeralRunnerJobModeAttachToQueued   EphemeralRunnerJobMode = \"attach_to_queued\"\n)\n```\n\n```go\ntype EphemeralRunnerJobRequest struct {\n\tMode                EphemeralRunnerJobMode `json:\"mode\"`\n\tEnvironment         string                 `json:\"environment\"`\n\tOS                  string                 `json:\"os\"`\n\tWorkerID            string                 `json:\"worker_id\"`\n\tTaskID              string                 `json:\"task_id\"`\n\tOrganization        string                 `json:\"organization\"`\n\tRepository          string                 `json:\"repository,omitempty\"`\n\tWorkflow            string                 `json:\"workflow,omitempty\"`\n\tRef                 string                 `json:\"ref,omitempty\"`\n\tWorkflowRunID       int64                  `json:\"workflow_run_id,omitempty\"`\n\tWorkflowJobID       int64                  `json:\"workflow_job_id,omitempty\"`\n\tWorkflowInputs      map[string]string      `json:\"workflow_inputs,omitempty\"`\n\tArtifactPaths       []string               `json:\"artifact_paths,omitempty\"`\n\tRunnerGroup         string                 `json:\"runner_group,omitempty\"`\n\tRequirePreflight    bool                   `json:\"require_preflight,omitempty\"`\n\tTimeoutSeconds      int                    `json:\"timeout_seconds,omitempty\"`\n\tTimeout             time.Duration          `json:\"-\"`\n\tRequiredRuntimeCaps []string               `json:\"required_runtime_caps,omitempty\"`\n\tRuntimeCaps         []string               `json:\"-\"`\n}\n```\n\n```go\ntype EphemeralRunnerJobResult struct {\n\tRunnerID                   int64                          `json:\"runner_id\"`\n\tRunnerName                 string                         `json:\"runner_name\"`\n\tLabels                     []string                       `json:\"labels\"`\n\tWorkflowRunID              int64                          `json:\"workflow_run_id\"`\n\tWorkflowJobID              int64                          `json:\"workflow_job_id\"`\n\tWorkflowJobStatus          string                         `json:\"workflow_job_status,omitempty\"`\n\tWorkflowVerificationStatus string                         `json:\"workflow_verification_status,omitempty\"`\n\tWorkerID                   string                         `json:\"worker_id\"`\n\tTaskID                     string                         `json:\"task_id\"`\n\tWorkloadArtifacts          []string                       `json:\"workload_artifacts,omitempty\"`\n\tCleanupStatus              string                         `json:\"cleanup_status\"`\n\tPreflight                  *GitHubRunnerProviderPreflight `json:\"preflight,omitempty\"`\n\tRedactedError              string                         `json:\"redacted_error,omitempty\"`\n}\n```\n\n```go\ntype EphemeralRunnerJobSpec struct {\n\tRunnerName  string   `json:\"runner_name\"`\n\tLabels      []string `json:\"labels\"`\n\tRunnerGroup string   `json:\"runner_group,omitempty\"`\n}\n```\n\n```go\nfunc BuildEphemeralRunnerJobSpec(req EphemeralRunnerJobRequest) (EphemeralRunnerJobSpec, error)\n```\n\n```go\ntype GitEvent struct {\n\tProvider   string          `json:\"provider\"`    // \"github\"\n\tEventType  string          `json:\"event_type\"`  // \"push\", \"pull_request\", etc.\n\tRepository string          `json:\"repository\"`  // \"owner/repo\"\n\tBranch     string          `json:\"branch\"`      // \"main\", \"feature/xyz\"\n\tCommit     string          `json:\"commit\"`      // SHA\n\tAuthor     string          `json:\"author\"`      // username\n\tMessage    string          `json:\"message\"`     // commit message or PR title\n\tURL        string          `json:\"url\"`         // link to commit/PR\n\tRawPayload json.RawMessage `json:\"raw_payload\"` // original payload\n\tTimestamp  time.Time       `json:\"timestamp\"`\n}\n```\nGitEvent is the normalized event schema published to the message broker.\n\n```go\ntype GitHubClient interface {\n\tTriggerWorkflow(ctx context.Context, owner, repo, workflow, ref string, inputs map[string]string, token string) error\n\tGetWorkflowRun(ctx context.Context, owner, repo string, runID int64, token string) (*WorkflowRun, error)\n}\n```\nGitHubClient is the interface for interacting with the GitHub API. It is defined as an interface so tests can inject a mock.\n\n```go\ntype GitHubOrgRunner struct {\n\tID     int64    `json:\"id\"`\n\tName   string   `json:\"name\"`\n\tStatus string   `json:\"status\"`\n\tBusy   bool     `json:\"busy\"`\n\tLabels []string `json:\"labels\"`\n}\n```\n\n```go\ntype GitHubRunnerClient interface {\n\tRegistrationToken(ctx context.Context, owner, repo, token string) (GitHubRunnerRegistrationToken, error)\n\tRemoveRunner(ctx context.Context, owner, repo string, runnerID int64, token string) error\n\tOrgRegistrationToken(ctx context.Context, organization, token string) (GitHubRunnerRegistrationToken, error)\n\tGenerateOrgJITConfig(ctx context.Context, req GitHubRunnerJITConfigRequest, token string) (GitHubRunnerJITConfig, error)\n\tGetOrgRunner(ctx context.Context, organization string, runnerID int64, token string) (GitHubOrgRunner, error)\n\tRemoveOrgRunner(ctx context.Context, organization string, runnerID int64, token string) error\n\tPreflightOrg(ctx context.Context, req GitHubRunnerProviderPreflightRequest, token string) (GitHubRunnerProviderPreflight, error)\n\tDispatchWorkflow(ctx context.Context, owner, repo, workflow, ref string, inputs map[string]string, expectedWorkflowPath, expectedHeadSHA, token string) (GitHubWorkflowDispatch, error)\n\tGetWorkflowRun(ctx context.Context, owner, repo string, runID int64, token string) (GitHubWorkflowRun, error)\n\tListWorkflowRuns(ctx context.Context, owner, repo, workflow string, createdAfter time.Time, token string) ([]GitHubWorkflowRun, error)\n\tListWorkflowRunJobs(ctx context.Context, owner, repo string, runID int64, token string) ([]GitHubWorkflowJob, error)\n}\n```\n\n```go\ntype GitHubRunnerJITConfig struct {\n\tRunnerID         int64  `json:\"runner_id\"`\n\tRunnerName       string `json:\"runner_name\"`\n\tEncodedJITConfig string `json:\"encoded_jit_config\"`\n}\n```\n\n```go\ntype GitHubRunnerJITConfigRequest struct {\n\tOrganization  string\n\tRunnerName    string\n\tRunnerGroupID int64\n\tLabels        []string\n}\n```\n\n```go\ntype GitHubRunnerJITRegistration struct {\n\tRunnerID         int64                          `json:\"runner_id\"`\n\tRunnerName       string                         `json:\"runner_name\"`\n\tEncodedJITConfig string                         `json:\"encoded_jit_config\"`\n\tOwnershipToken   string                         `json:\"ownership_token\"`\n\tPreflight        *GitHubRunnerProviderPreflight `json:\"preflight\"`\n}\n```\n\n```go\ntype GitHubRunnerProviderHTTPService struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewGitHubRunnerProviderHTTPService(name string, raw map[string]any) (*GitHubRunnerProviderHTTPService, error)\n```\n\n```go\nfunc (s *GitHubRunnerProviderHTTPService) Handler() http.Handler\n```\n\n```go\nfunc (s *GitHubRunnerProviderHTTPService) Stop(ctx context.Context) error\n```\n\n```go\ntype GitHubRunnerProviderPreflight struct {\n\tOrganization            string   `json:\"organization\"`\n\tRunnerGroup             string   `json:\"runner_group,omitempty\"`\n\tRunnerGroupID           int64    `json:\"runner_group_id,omitempty\"`\n\tRef                     string   `json:\"ref,omitempty\"`\n\tResolvedWorkflowPath    string   `json:\"resolved_workflow_path,omitempty\"`\n\tResolvedRefSHA          string   `json:\"resolved_ref_sha,omitempty\"`\n\tExistingLabels          []string `json:\"existing_labels,omitempty\"`\n\tConflictingLabels       []string `json:\"conflicting_labels,omitempty\"`\n\tLabelsObserved          int      `json:\"labels_observed,omitempty\"`\n\tExistingLabelsTruncated bool     `json:\"existing_labels_truncated,omitempty\"`\n\tRunnerCountChecked      int      `json:\"runner_count_checked,omitempty\"`\n\tActionsEnabled          bool     `json:\"actions_enabled\"`\n\tSelfHostedAllowed       bool     `json:\"self_hosted_allowed\"`\n}\n```\n\n```go\ntype GitHubRunnerProviderPreflightRequest struct {\n\tOrganization string\n\tRepository   string\n\tWorkflow     string\n\tRef          string\n\tRunnerName   string\n\tRunnerGroup  string\n\tLabels       []string\n}\n```\n\n```go\ntype GitHubRunnerRegistrationToken struct {\n\tToken     string    `json:\"token\"`\n\tExpiresAt time.Time `json:\"expires_at\"`\n}\n```\n\n```go\ntype GitHubWorkflowDispatch struct {\n\tWorkflowRunID    int64  `json:\"workflow_run_id\"`\n\tRunURL           string `json:\"run_url\"`\n\tHTMLURL          string `json:\"html_url\"`\n\tValidatedHeadSHA string `json:\"head_sha\"`\n\tVerification     string `json:\"verification_status,omitempty\"`\n}\n```\n\n```go\ntype GitHubWorkflowJob struct {\n\tID              int64    `json:\"id\"`\n\tRunID           int64    `json:\"run_id,omitempty\"`\n\tStatus          string   `json:\"status\"`\n\tConclusion      string   `json:\"conclusion,omitempty\"`\n\tRunnerID        int64    `json:\"runner_id,omitempty\"`\n\tRunnerName      string   `json:\"runner_name,omitempty\"`\n\tRunnerGroupID   int64    `json:\"runner_group_id,omitempty\"`\n\tRunnerGroupName string   `json:\"runner_group_name,omitempty\"`\n\tLabels          []string `json:\"labels,omitempty\"`\n\tStartedAt       string   `json:\"started_at,omitempty\"`\n\tCompletedAt     string   `json:\"completed_at,omitempty\"`\n}\n```\n\n```go\ntype GitHubWorkflowRun struct {\n\tID         int64  `json:\"id\"`\n\tStatus     string `json:\"status\"`\n\tConclusion string `json:\"conclusion,omitempty\"`\n\tPath       string `json:\"path,omitempty\"`\n\tHeadBranch string `json:\"head_branch,omitempty\"`\n\tHeadSHA    string `json:\"head_sha,omitempty\"`\n\tHTMLURL    string `json:\"html_url,omitempty\"`\n\tCreatedAt  string `json:\"created_at,omitempty\"`\n\tUpdatedAt  string `json:\"updated_at,omitempty\"`\n}\n```\n\n```go\ntype RunnerPolicyDesired struct {\n\tSchemaVersion            string               `json:\"schema_version\"`\n\tOrganization             string               `json:\"organization\"`\n\tRunnerGroup              string               `json:\"runner_group\"`\n\tRepository               string               `json:\"repository\"`\n\tWorkflow                 string               `json:\"workflow\"`\n\tVisibility               string               `json:\"visibility\"`\n\tAllowsPublicRepositories bool                 `json:\"allows_public_repositories\"`\n\tRestrictedToWorkflows    bool                 `json:\"restricted_to_workflows\"`\n\tRunnerIDs                []int64              `json:\"runner_ids\"`\n\tProtectedRunnerIDs       []int64              `json:\"protected_runner_ids\"`\n\tVariable                 RunnerPolicyVariable `json:\"variable\"`\n}\n```\n\n```go\ntype RunnerPolicyResult struct {\n\tTransactionID string `json:\"transaction_id\"`\n\tPhase         string `json:\"phase\"`\n\tBeforeHash    string `json:\"before_hash\"`\n\tAfterHash     string `json:\"after_hash,omitempty\"`\n}\n```\n\n```go\ntype RunnerPolicyVariable struct {\n\tName  string `json:\"name\"`\n\tValue string `json:\"value\"`\n}\n```\n\n```go\ntype SDKClient struct {\n\tGH *github.Client\n}\n```\nSDKClient wraps the go-github client with auth support.\n\n```go\nfunc NewSDKClient(token string) *SDKClient\n```\nNewSDKClient creates a client authenticated with a personal access token.\n\n```go\nfunc NewSDKClientFromTransport(rt http.RoundTripper) *SDKClient\n```\nNewSDKClientFromTransport creates a client from an http.RoundTripper (for GitHub App auth).\n\n```go\ntype WorkflowRun struct {\n\tID         int64  `json:\"id\"`\n\tStatus     string `json:\"status\"`\n\tConclusion string `json:\"conclusion\"`\n\tHTMLURL    string `json:\"html_url\"`\n}\n```\nWorkflowRun represents a GitHub Actions workflow run.\n\n","path":"github.com/GoCodeAlone/workflow-plugin-github/internal","name":"internal","synopsis":"Package internal implements the workflow-plugin-github plugin, providing GitHub webhook handling and GitHub Actions workflow management.","isRedistributable":true}
