Comprehensive management of GitHub Actions including workflows, runs, artifacts, secrets, variables, runners, and permissions.
The ActionsService provides 167 methods for complete GitHub Actions management.
type ActionsService struct{}// ListWorkflows lists all workflows in a repository
func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*Workflows, *Response, error)
// GetWorkflowByID gets a specific workflow by ID
func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Workflow, *Response, error)
// GetWorkflowByFileName gets a specific workflow by file name
func (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Workflow, *Response, error)// GetWorkflowUsageByID gets a specific workflow usage by ID (in billable milliseconds)
func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo string, workflowID int64) (*WorkflowUsage, *Response, error)
// GetWorkflowUsageByFileName gets a specific workflow usage by file name
func (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, repo, workflowFileName string) (*WorkflowUsage, *Response, error)// EnableWorkflowByID enables a workflow and sets the state to active
func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error)
// EnableWorkflowByFileName enables a workflow and sets the state to active
func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error)
// DisableWorkflowByID disables a workflow and sets the state to disabled_manually
func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error)
// DisableWorkflowByFileName disables a workflow and sets the state to disabled_manually
func (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error)// CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow by ID
func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*Response, error)
// CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow by file name
func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*Response, error)
type CreateWorkflowDispatchEventRequest struct {
Ref string
Inputs map[string]interface{}
}Usage:
// Trigger a workflow with inputs
event := github.CreateWorkflowDispatchEventRequest{
Ref: "main",
Inputs: map[string]interface{}{
"name": "John Doe",
"environment": "production",
},
}
_, err := client.Actions.CreateWorkflowDispatchEventByFileName(
ctx, "owner", "repo", "deploy.yml", event)// ListRepositoryWorkflowRuns lists all workflow runs for a repository
func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error)
// ListWorkflowRunsByID lists all workflow runs by workflow ID
func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error)
// ListWorkflowRunsByFileName lists all workflow runs by workflow file name
func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error)
// GetWorkflowRunByID gets a specific workflow run by ID
func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error)
// GetWorkflowRunAttempt gets a specific workflow run attempt
func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo string, runID int64, attemptNumber int64, opts *WorkflowRunAttemptOptions) (*WorkflowRun, *Response, error)// RerunWorkflowByID re-runs a workflow by ID
func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error)
// RerunFailedJobsByID re-runs all failed jobs and their dependent jobs in a workflow run
func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*Response, error)
// CancelWorkflowRunByID cancels a workflow run by ID
func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error)
// DeleteWorkflowRun deletes a workflow run by ID
func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error)// GetWorkflowRunUsageByID gets workflow run usage (billable milliseconds)
func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRunUsage, *Response, error)
// GetWorkflowRunLogs gets a redirect URL to download plain text logs
func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, maxRedirects int) (*url.URL, *Response, error)
// GetWorkflowRunAttemptLogs gets a redirect URL to download logs for a specific attempt
func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int64, maxRedirects int) (*url.URL, *Response, error)
// DeleteWorkflowRunLogs deletes all logs for a workflow run
func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64) (*Response, error)// GetPendingDeployments gets all deployment environments for a workflow run that are waiting for protection rules
func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo string, runID int64) ([]*PendingDeployment, *Response, error)
// PendingDeployments approves or rejects pending deployments
func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo string, runID int64, request *PendingDeploymentsRequest) ([]*Deployment, *Response, error)
type PendingDeploymentsRequest struct {
EnvironmentIDs []int64
State string // "approved" or "rejected"
Comment string
}// ListWorkflowJobs lists all jobs for a workflow run
func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error)
// ListWorkflowJobsAttempt lists jobs for a specific workflow run attempt
func (s *ActionsService) ListWorkflowJobsAttempt(ctx context.Context, owner, repo string, runID, attemptNumber int64, opts *ListOptions) (*Jobs, *Response, error)
// GetWorkflowJobByID gets a specific job in a workflow run by ID
func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error)// RerunJobByID re-runs a job and its dependent jobs in a workflow run
func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, jobID int64) (*Response, error)
// GetWorkflowJobLogs gets a redirect URL to download plain text logs for a job
func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, maxRedirects int) (*url.URL, *Response, error)// ListArtifacts lists all artifacts that belong to a repository
func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListOptions) (*ArtifactList, *Response, error)
// ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run
func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error)
// GetArtifact gets a specific artifact for a workflow run
func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error)// DownloadArtifact gets a redirect URL to download an archive for a repository
func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error)
// DeleteArtifact deletes a workflow run artifact
func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error)Usage:
// List artifacts for a workflow run
artifacts, _, err := client.Actions.ListWorkflowRunArtifacts(ctx, "owner", "repo", runID, nil)
if err != nil {
// Handle error
}
// Download an artifact
url, _, err := client.Actions.DownloadArtifact(ctx, "owner", "repo", artifactID, 0)
if err != nil {
// Handle error
}
// Use url to download the artifact archive
resp, err := http.Get(url.String())
defer resp.Body.Close()
// ... process download// GetRepoPublicKey gets a public key that should be used for secret encryption
func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error)
type PublicKey struct {
KeyID *string
Key *string
}// ListRepoSecrets lists all secrets available in a repository
func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error)
// GetRepoSecret gets a single repository secret (without revealing its encrypted value)
func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error)
// CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value
func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error)
// DeleteRepoSecret deletes a secret in a repository
func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error)
type EncryptedSecret struct {
Name string
EncryptedValue string
KeyID string
}Usage:
// Get public key for encryption
publicKey, _, err := client.Actions.GetRepoPublicKey(ctx, "owner", "repo")
// Encrypt secret value (use libsodium or x/crypto/nacl)
encryptedValue := encryptSecret(*publicKey.Key, "secret-value")
// Create or update secret
secret := &github.EncryptedSecret{
Name: "MY_SECRET",
EncryptedValue: encryptedValue,
KeyID: *publicKey.KeyID,
}
_, err = client.Actions.CreateOrUpdateRepoSecret(ctx, "owner", "repo", secret)// GetOrgPublicKey gets a public key for organization secret encryption
func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error)// ListOrgSecrets lists all secrets available in an organization
func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error)
// GetOrgSecret gets a single organization secret
func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error)
// CreateOrUpdateOrgSecret creates or updates an organization secret
func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error)
// DeleteOrgSecret deletes a secret in an organization
func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error)// ListSelectedReposForOrgSecret lists repositories that have access to a secret
func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error)
// SetSelectedReposForOrgSecret sets the repositories that have access to a secret
func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error)
// AddSelectedRepoToOrgSecret adds a repository to an organization secret
func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error)
// RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret
func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error)// ListRepoOrgSecrets lists all organization secrets available in a repository
func (s *ActionsService) ListRepoOrgSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error)// GetEnvPublicKey gets a public key for environment secret encryption
func (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error)
// ListEnvSecrets lists all secrets available in an environment
func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error)
// GetEnvSecret gets a single environment secret
func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error)
// CreateOrUpdateEnvSecret creates or updates an environment secret
func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error)
// DeleteEnvSecret deletes a secret in an environment
func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error)// ListRepoVariables lists all variables available in a repository
func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error)
// GetRepoVariable gets a single repository variable
func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name string) (*ActionsVariable, *Response, error)
// CreateRepoVariable creates a repository variable
func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error)
// UpdateRepoVariable updates a repository variable
func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error)
// DeleteRepoVariable deletes a variable in a repository
func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, name string) (*Response, error)
type ActionsVariable struct {
Name string
Value string
CreatedAt Timestamp
UpdatedAt Timestamp
}// ListOrgVariables lists all variables available in an organization
func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts *ListOptions) (*ActionsVariables, *Response, error)
// GetOrgVariable gets a single organization variable
func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) (*ActionsVariable, *Response, error)
// CreateOrgVariable creates an organization variable
func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error)
// UpdateOrgVariable updates an organization variable
func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error)
// DeleteOrgVariable deletes a variable in an organization
func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string) (*Response, error)// ListSelectedReposForOrgVariable lists repositories that have access to a variable
func (s *ActionsService) ListSelectedReposForOrgVariable(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error)
// SetSelectedReposForOrgVariable sets the repositories that have access to a variable
func (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error)
// AddSelectedRepoToOrgVariable adds a repository to an organization variable
func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error)
// RemoveSelectedRepoFromOrgVariable removes a repository from an organization variable
func (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error)
// ListRepoOrgVariables lists all organization variables available in a repository
func (s *ActionsService) ListRepoOrgVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error)// ListEnvVariables lists all variables available in an environment
func (s *ActionsService) ListEnvVariables(ctx context.Context, owner, repo, env string, opts *ListOptions) (*ActionsVariables, *Response, error)
// GetEnvVariable gets a single environment variable
func (s *ActionsService) GetEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*ActionsVariable, *Response, error)
// CreateEnvVariable creates an environment variable
func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error)
// UpdateEnvVariable updates an environment variable
func (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error)
// DeleteEnvVariable deletes a variable in an environment
func (s *ActionsService) DeleteEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*Response, error)// ListRunners lists all self-hosted runners for a repository
func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListRunnersOptions) (*Runners, *Response, error)
// GetRunner gets a specific self-hosted runner for a repository
func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error)
// RemoveRunner forces the removal of a self-hosted runner in a repository
func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error)
// ListRunnerApplicationDownloads lists self-hosted runner application binaries
func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error)
// CreateRegistrationToken creates a token that can be used to add a self-hosted runner
func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error)
// CreateRemoveToken creates a token that can be used to remove a self-hosted runner
func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error)
type RegistrationToken struct {
Token *string
ExpiresAt *Timestamp
}
type RemoveToken struct {
Token *string
ExpiresAt *Timestamp
}// ListOrganizationRunners lists all self-hosted runners for an organization
func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string, opts *ListRunnersOptions) (*Runners, *Response, error)
// GetOrganizationRunner gets a specific self-hosted runner for an organization
func (s *ActionsService) GetOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Runner, *Response, error)
// RemoveOrganizationRunner forces the removal of a self-hosted runner from an organization
func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Response, error)
// ListOrganizationRunnerApplicationDownloads lists self-hosted runner application binaries
func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, org string) ([]*RunnerApplicationDownload, *Response, error)
// CreateOrganizationRegistrationToken creates a token to add a self-hosted runner to an organization
func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, org string) (*RegistrationToken, *Response, error)
// CreateOrganizationRemoveToken creates a token to remove a self-hosted runner from an organization
func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, org string) (*RemoveToken, *Response, error)// GenerateRepoJITConfig generates a just-in-time configuration for a repository
func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error)
// GenerateOrgJITConfig generates a just-in-time configuration for an organization
func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, org string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error)
type GenerateJITConfigRequest struct {
Name string
RunnerGroupID int64
Labels []string
WorkFolder *string
}
type JITRunnerConfig struct {
Runner *Runner
EncodedJITConfig *string
}// ListHostedRunners lists all GitHub-hosted runners for an organization
func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts *ListOptions) (*HostedRunners, *Response, error)
// GetHostedRunner gets a GitHub-hosted runner in an organization
func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error)
// CreateHostedRunner creates a GitHub-hosted runner for an organization
func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, request *HostedRunnerRequest) (*HostedRunner, *Response, error)
// UpdateHostedRunner updates a GitHub-hosted runner for an organization
func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error)
// DeleteHostedRunner deletes a GitHub-hosted runner from an organization
func (s *ActionsService) DeleteHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error)
// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners
func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org string) (*HostedRunnerPlatforms, *Response, error)
// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners
func (s *ActionsService) GetHostedRunnerMachineSpecs(ctx context.Context, org string) (*HostedRunnerMachineSpecs, *Response, error)
// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners
func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error)
// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners
func (s *ActionsService) GetHostedRunnerPartnerImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error)
// GetHostedRunnerLimits gets the GitHub-hosted runners static public IP limits
func (s *ActionsService) GetHostedRunnerLimits(ctx context.Context, org string) (*HostedRunnerPublicIPLimits, *Response, error)// ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization
func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error)
// GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization
func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error)
// CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization
func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error)
// UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization
func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error)
// DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization
func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error)// ListRepositoryAccessRunnerGroup lists repositories with access to a self-hosted runner group
func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error)
// SetRepositoryAccessRunnerGroup replaces the list of repositories with access to a runner group
func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error)
// AddRepositoryAccessRunnerGroup adds a repository to the list with access to a runner group
func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error)
// RemoveRepositoryAccessRunnerGroup removes a repository from the list with access to a runner group
func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error)// ListRunnerGroupRunners lists self-hosted runners in a specific organization runner group
func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error)
// SetRunnerGroupRunners replaces the list of self-hosted runners in a group
func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error)
// AddRunnerGroupRunners adds a self-hosted runner to a runner group
func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error)
// RemoveRunnerGroupRunners removes a self-hosted runner from a group
func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error)// GetActionsPermissions gets the GitHub Actions permissions policy for repositories
func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error)
// UpdateActionsPermissions sets the permissions policy for repositories
func (s *ActionsService) UpdateActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error)
type ActionsPermissions struct {
EnabledRepositories *string // "all", "none", or "selected"
AllowedActions *string // "all", "local_only", or "selected"
SelectedActionsURL *string
}// GetActionsAllowed gets the actions that are allowed in an organization
func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error)
// UpdateActionsAllowed sets the actions that are allowed in an organization
func (s *ActionsService) UpdateActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error)
type ActionsAllowed struct {
GithubOwnedAllowed *bool
VerifiedAllowed *bool
PatternsAllowed []string
}// GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy in an enterprise
func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, enterprise string) (*ActionsPermissions, *Response, error)
// UpdateActionsPermissionsInEnterprise sets the permissions policy in an enterprise
func (s *ActionsService) UpdateActionsPermissionsInEnterprise(ctx context.Context, enterprise string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error)
// GetActionsAllowedInEnterprise gets the actions that are allowed in an enterprise
func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, enterprise string) (*ActionsAllowed, *Response, error)
// UpdateActionsAllowedInEnterprise sets the actions that are allowed in an enterprise
func (s *ActionsService) UpdateActionsAllowedInEnterprise(ctx context.Context, enterprise string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error)// ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions
func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, org string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error)
// SetEnabledReposInOrg replaces the list of selected repositories enabled for GitHub Actions
func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, org string, repositoryIDs []int64) (*Response, error)
// AddEnabledReposInOrg adds a repository to the list of selected repositories enabled for GitHub Actions
func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, org string, repositoryID int64) (*Response, error)
// RemoveEnabledReposInOrg removes a repository from the list of selected repositories enabled for GitHub Actions
func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, org string, repositoryID int64) (*Response, error)
// ListEnabledOrgsInEnterprise lists the selected organizations that are enabled for GitHub Actions
func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, enterprise string, opts *ListOptions) (*ActionsEnabledOnEnterpriseOrgs, *Response, error)
// SetEnabledOrgsInEnterprise replaces the list of selected organizations enabled for GitHub Actions
func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, enterprise string, organizationIDs []int64) (*Response, error)
// AddEnabledOrgInEnterprise adds an organization to the list enabled for GitHub Actions
func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, enterprise string, organizationID int64) (*Response, error)
// RemoveEnabledOrgInEnterprise removes an organization from the list enabled for GitHub Actions
func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, enterprise string, organizationID int64) (*Response, error)// GetDefaultWorkflowPermissionsInOrganization gets the GitHub Actions default workflow permissions
func (s *ActionsService) GetDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string) (*DefaultWorkflowPermissionOrganization, *Response, error)
// UpdateDefaultWorkflowPermissionsInOrganization sets the GitHub Actions default workflow permissions
func (s *ActionsService) UpdateDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string, permissions DefaultWorkflowPermissionOrganization) (*DefaultWorkflowPermissionOrganization, *Response, error)
// GetDefaultWorkflowPermissionsInEnterprise gets the GitHub Actions default workflow permissions in an enterprise
func (s *ActionsService) GetDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string) (*DefaultWorkflowPermissionEnterprise, *Response, error)
// UpdateDefaultWorkflowPermissionsInEnterprise sets the GitHub Actions default workflow permissions in an enterprise
func (s *ActionsService) UpdateDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string, permissions DefaultWorkflowPermissionEnterprise) (*DefaultWorkflowPermissionEnterprise, *Response, error)
type DefaultWorkflowPermissionOrganization struct {
DefaultWorkflowPermissions *string // "read" or "write"
CanApprovePullRequestReviews *bool
}// GetForkPRContributorApprovalPermissions gets the fork PR contributor approval permissions
func (s *ActionsService) GetForkPRContributorApprovalPermissions(ctx context.Context, owner, repo string) (*ContributorApprovalPermissions, *Response, error)
// UpdateForkPRContributorApprovalPermissions sets the fork PR contributor approval permissions
func (s *ActionsService) UpdateForkPRContributorApprovalPermissions(ctx context.Context, owner, repo string, policy ContributorApprovalPermissions) (*Response, error)
// GetOrganizationForkPRContributorApprovalPermissions gets the fork PR contributor approval permissions in an organization
func (s *ActionsService) GetOrganizationForkPRContributorApprovalPermissions(ctx context.Context, org string) (*ContributorApprovalPermissions, *Response, error)
// UpdateOrganizationForkPRContributorApprovalPermissions sets the fork PR contributor approval permissions in an organization
func (s *ActionsService) UpdateOrganizationForkPRContributorApprovalPermissions(ctx context.Context, org string, policy ContributorApprovalPermissions) (*Response, error)
// GetPrivateRepoForkPRWorkflowSettingsInOrganization gets private repo fork PR workflow settings
func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string) (*WorkflowsPermissions, *Response, error)
// UpdatePrivateRepoForkPRWorkflowSettingsInOrganization sets private repo fork PR workflow settings
func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string, permissions *WorkflowsPermissionsOpt) (*Response, error)
// GetPrivateRepoForkPRWorkflowSettingsInEnterprise gets private repo fork PR workflow settings
func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string) (*WorkflowsPermissions, *Response, error)
// UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise sets private repo fork PR workflow settings
func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string, permissions *WorkflowsPermissionsOpt) (*Response, error)
// GetSelfHostedRunnerPermissionsInEnterprise gets the self-hosted runner permissions in an enterprise
func (s *ActionsService) GetSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string) (*SelfHostRunnerPermissionsEnterprise, *Response, error)
// UpdateSelfHostedRunnerPermissionsInEnterprise sets the self-hosted runner permissions in an enterprise
func (s *ActionsService) UpdateSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string, permissions SelfHostRunnerPermissionsEnterprise) (*Response, error)
// GetEnterpriseForkPRContributorApprovalPermissions gets the fork PR contributor approval permissions in an enterprise
func (s *ActionsService) GetEnterpriseForkPRContributorApprovalPermissions(ctx context.Context, enterprise string) (*ContributorApprovalPermissions, *Response, error)
// UpdateEnterpriseForkPRContributorApprovalPermissions sets the fork PR contributor approval permissions in an enterprise
func (s *ActionsService) UpdateEnterpriseForkPRContributorApprovalPermissions(ctx context.Context, enterprise string, policy ContributorApprovalPermissions) (*Response, error)// GetSelfHostedRunnersSettingsInOrganization gets the self-hosted runners settings in an organization
func (s *ActionsService) GetSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string) (*SelfHostedRunnersSettingsOrganization, *Response, error)
// UpdateSelfHostedRunnersSettingsInOrganization sets the self-hosted runners settings in an organization
func (s *ActionsService) UpdateSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string, opt SelfHostedRunnersSettingsOrganizationOpt) (*Response, error)
// ListRepositoriesSelfHostedRunnersAllowedInOrganization lists repositories allowed to use self-hosted runners
func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, opts *ListOptions) (*SelfHostedRunnersAllowedRepos, *Response, error)
// SetRepositoriesSelfHostedRunnersAllowedInOrganization sets the list of repositories allowed to use self-hosted runners
func (s *ActionsService) SetRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryIDs []int64) (*Response, error)
// AddRepositorySelfHostedRunnersAllowedInOrganization adds a repository to the list allowed to use self-hosted runners
func (s *ActionsService) AddRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repoID int64) (*Response, error)
// RemoveRepositorySelfHostedRunnersAllowedInOrganization removes a repository from the list allowed to use self-hosted runners
func (s *ActionsService) RemoveRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repoID int64) (*Response, error)// GetArtifactAndLogRetentionPeriodInOrganization gets the artifact and log retention period
func (s *ActionsService) GetArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string) (*ArtifactPeriod, *Response, error)
// UpdateArtifactAndLogRetentionPeriodInOrganization sets the artifact and log retention period
func (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string, period ArtifactPeriodOpt) (*Response, error)
// GetArtifactAndLogRetentionPeriodInEnterprise gets the artifact and log retention period in an enterprise
func (s *ActionsService) GetArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string) (*ArtifactPeriod, *Response, error)
// UpdateArtifactAndLogRetentionPeriodInEnterprise sets the artifact and log retention period in an enterprise
func (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string, period ArtifactPeriodOpt) (*Response, error)
type ArtifactPeriod struct {
Days *int
MaximumAllowedDays *int
}
type ArtifactPeriodOpt struct {
Days *int
}// ListCaches lists the GitHub Actions caches for a repository
func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opts *ActionsCacheListOptions) (*ActionsCacheList, *Response, error)
// DeleteCachesByKey deletes one or more GitHub Actions caches for a repository using a cache key
func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key string, ref *string) (*Response, error)
// DeleteCachesByID deletes a GitHub Actions cache for a repository using a cache ID
func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error)
// GetCacheUsageForRepo gets GitHub Actions cache usage for a repository
func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error)
// GetTotalCacheUsageForOrg gets the total GitHub Actions cache usage for an organization
func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error)
// ListCacheUsageByRepoForOrg lists repositories and their GitHub Actions cache usage for an organization
func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org string, opts *ListOptions) (*CacheUsageList, *Response, error)
// GetTotalCacheUsageForEnterprise gets the total GitHub Actions cache usage for an enterprise
func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error)// GetRepoOIDCSubjectClaimCustomTemplate gets the subject claim customization template for a repository
func (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string) (*OIDCSubjectClaimCustomTemplate, *Response, error)
// SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization template for a repository
func (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string, template *OIDCSubjectClaimCustomTemplate) (*Response, error)
// GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization
func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string) (*OIDCSubjectClaimCustomTemplate, *Response, error)
// SetOrgOIDCSubjectClaimCustomTemplate sets the subject claim customization template for an organization
func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error)
type OIDCSubjectClaimCustomTemplate struct {
IncludeClaimKeys []string
}// ReviewCustomDeploymentProtectionRule approves or rejects custom deployment protection rules
func (s *ActionsService) ReviewCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, runID int64, reviewRequest *CustomDeploymentProtectionRuleReviewRequest) (*Response, error)
type CustomDeploymentProtectionRuleReviewRequest struct {
EnvironmentName string
State string // "approved" or "rejected"
Comment string
}type Workflow struct {
ID *int64
NodeID *string
Name *string
Path *string
State *string
CreatedAt *Timestamp
UpdatedAt *Timestamp
URL *string
HTMLURL *string
BadgeURL *string
}type WorkflowRun struct {
ID *int64
Name *string
NodeID *string
HeadBranch *string
HeadSHA *string
RunNumber *int
RunAttempt *int
Event *string
DisplayTitle *string
Status *string
Conclusion *string
WorkflowID *int64
CheckSuiteID *int64
CheckSuiteNodeID *string
URL *string
HTMLURL *string
PullRequests []*PullRequest
CreatedAt *Timestamp
UpdatedAt *Timestamp
RunStartedAt *Timestamp
JobsURL *string
LogsURL *string
CheckSuiteURL *string
ArtifactsURL *string
CancelURL *string
RerunURL *string
HeadCommit *HeadCommit
WorkflowURL *string
Repository *Repository
HeadRepository *Repository
Actor *User
TriggeringActor *User
}type WorkflowJob struct {
ID *int64
RunID *int64
RunURL *string
RunAttempt *int
NodeID *string
HeadSHA *string
URL *string
HTMLURL *string
Status *string
Conclusion *string
CreatedAt *Timestamp
StartedAt *Timestamp
CompletedAt *Timestamp
Name *string
Steps []*TaskStep
CheckRunURL *string
Labels []string
RunnerID *int64
RunnerName *string
RunnerGroupID *int64
RunnerGroupName *string
WorkflowName *string
}type Artifact struct {
ID *int64
NodeID *string
Name *string
SizeInBytes *int64
URL *string
ArchiveDownloadURL *string
Expired *bool
CreatedAt *Timestamp
ExpiresAt *Timestamp
UpdatedAt *Timestamp
WorkflowRun *ArtifactWorkflowRun
}type Runner struct {
ID *int64
Name *string
OS *string
Status *string
Busy *bool
Labels []*RunnerLabels
}type RunnerGroup struct {
ID *int64
Name *string
Visibility *string
Default *bool
SelectedRepositoriesURL *string
RunnersURL *string
Inherited *bool
AllowsPublicRepositories *bool
RestrictedToWorkflows *bool
SelectedWorkflows []string
}type Secret struct {
Name string
CreatedAt Timestamp
UpdatedAt Timestamp
Visibility string
SelectedRepositoriesURL string
}type ListWorkflowRunsOptions struct {
Actor string
Branch string
Event string
Status string
Created string
ExcludePullRequests bool
CheckSuiteID int64
HeadSHA string
ListOptions
}
type ListWorkflowJobsOptions struct {
Filter string // "latest", "all"
ListOptions
}
type ListRunnersOptions struct {
Name string
ListOptions
}
type ListOrgRunnerGroupOptions struct {
VisibleToRepository string
ListOptions
}
type ActionsCacheListOptions struct {
Key string
Ref string
Sort string
Direction string
ListOptions
}