github

package
v88.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Overview

Package github provides a client for using the GitHub API.

Usage:

import "github.com/google/go-github/v88/github"

Construct a new GitHub client using NewClient, then use the various services on the client to access different parts of the GitHub API. For example:

client, err := github.NewClient()
if err != nil {
	// Handle error.
}

// list all organizations for user "willnorris"
orgs, _, err := client.Organizations.List(ctx, "willnorris", nil)

Some API methods have optional parameters that can be passed. For example:

client, err := github.NewClient()
if err != nil {
	// Handle error.
}

// list public repositories for org "github"
opt := &github.RepositoryListByOrgOptions{Type: "public"}
repos, _, err := client.Repositories.ListByOrg(ctx, "github", opt)

The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at https://docs.github.com/rest?apiVersion=2022-11-28.

NOTE: Using the context package, one can easily pass cancellation signals and deadlines to various services of the client for handling a request. In case there is no context available, then context.Background can be used as a starting point.

For more sample code snippets, head over to the https://github.com/google/go-github/tree/master/example directory.

Authentication

Use WithAuthToken to configure your client to authenticate using an OAuth token (for example, a personal access token). This is what is needed for a majority of use cases aside from GitHub Apps.

client, err := github.NewClient(github.WithAuthToken("... your access token ..."))
if err != nil {
	// Handle error.
}

Note that when using an authenticated Client, all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users.

For API methods that require HTTP Basic Authentication, use the BasicAuthTransport.

GitHub Apps authentication can be provided by the https://github.com/bradleyfalzon/ghinstallation package. It supports both authentication as an installation, using an installation access token, and as an app, using a JWT. Use the WithTransport option to configure your client to use the appropriate transport.

To authenticate as an installation:

import "github.com/bradleyfalzon/ghinstallation"

func main() {
	// Wrap the shared transport for use with the integration ID 1 authenticating with installation ID 99.
	itr, err := ghinstallation.NewKeyFromFile(http.DefaultTransport, 1, 99, "2016-10-19.private-key.pem")
	if err != nil {
		// Handle error.
	}

	// Use installation transport with client
	client, err := github.NewClient(github.WithTransport(itr))
	if err != nil {
		// Handle error.
	}

	// Use client...
}

To authenticate as an app, using a JWT:

import "github.com/bradleyfalzon/ghinstallation"

func main() {
	// Wrap the shared transport for use with the application ID 1.
	atr, err := ghinstallation.NewAppsTransportKeyFromFile(http.DefaultTransport, 1, "2016-10-19.private-key.pem")
	if err != nil {
		// Handle error.
	}

	// Use app transport with client
	client, err := github.NewClient(github.WithTransport(atr))
	if err != nil {
		// Handle error.
	}

	// Use client...
}

Rate Limiting

GitHub imposes a rate limit on all API clients. Unauthenticated clients are limited to 60 requests per hour, while authenticated clients can make up to 5,000 requests per hour. The Search API has a custom rate limit. Unauthenticated clients are limited to 10 requests per minute, while authenticated clients can make up to 30 requests per minute. To receive the higher rate limit when making calls that are not issued on behalf of a user, use UnauthenticatedRateLimitedTransport.

The returned Response.Rate value contains the rate limit information from the most recent API call. If a recent enough response isn't available, you can use RateLimits to fetch the most up-to-date rate limit data for the client.

To detect an API rate limit error, you can check if its type is *RateLimitError. For secondary rate limits, you can check if its type is *AbuseRateLimitError:

repos, _, err := client.Repositories.List(ctx, "", nil)
if errors.As(err, new(*github.RateLimitError)) {
	log.Println("hit rate limit")
}
if errors.As(err, new(*github.AbuseRateLimitError)) {
	log.Println("hit secondary rate limit")
}

Learn more about GitHub rate limiting at https://docs.github.com/rest/rate-limit?apiVersion=2022-11-28.

Accepted Status

Some endpoints may return a 202 Accepted status code, meaning that the information required is not yet ready and was scheduled to be gathered on the GitHub side. Methods known to behave like this are documented specifying this behavior.

To detect this condition of error, you can check if its type is *AcceptedError:

stats, _, err := client.Repositories.ListContributorsStats(ctx, org, repo)
if errors.As(err, new(*github.AcceptedError)) {
	log.Println("scheduled on GitHub side")
}

Conditional Requests

The GitHub REST API has good support for conditional HTTP requests via the ETag header which will help prevent you from burning through your rate limit, as well as help speed up your application. go-github does not handle conditional requests directly, but is instead designed to work with a caching http.Transport.

Typically, an RFC 9111 compliant HTTP cache such as https://github.com/bartventer/httpcache is recommended. Alternatively, the https://github.com/bored-engineer/github-conditional-http-transport package relies on (undocumented) GitHub specific cache logic and is recommended when making requests using short-lived credentials such as a GitHub App installation token.

Learn more about GitHub conditional requests at https://docs.github.com/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate.

Creating and Updating Resources

All structs for GitHub resources use pointer values for all non-repeated fields. This allows distinguishing between unset fields and those set to a zero-value. A helper function, Ptr, has been provided to easily create these pointers for string, bool, and int values. For example:

// create a new private repository named "foo"
repo := &github.Repository{
	Name:    github.Ptr("foo"),
	Private: github.Ptr(true),
}
client.Repositories.Create(ctx, "", repo)

Users who have worked with protocol buffers should find this pattern familiar.

Pagination

All requests for resource collections (repos, pull requests, issues, etc.) support pagination. Pagination options are described in the ListOptions struct and passed to the list methods directly or as an embedded type of a more specific list options struct (for example PullRequestListOptions). Pages information is available via the Response struct.

client, err := github.NewClient()
if err != nil {
	// Handle error.
}

opt := &github.RepositoryListByOrgOptions{
	ListOptions: github.ListOptions{PerPage: 10},
}
// get all pages of results
var allRepos []*github.Repository
for {
	repos, resp, err := client.Repositories.ListByOrg(ctx, "github", opt)
	if err != nil {
		return err
	}
	allRepos = append(allRepos, repos...)
	if resp.NextPage == 0 {
		break
	}
	opt.Page = resp.NextPage
}

Index

Examples

Constants

View Source
const (
	BudgetScopeEnterprise   = "enterprise"
	BudgetScopeOrganization = "organization"
	BudgetScopeRepository   = "repository"
	BudgetScopeCostCenter   = "cost_center"
)

BudgetScope constants represent the scope of the budget.

View Source
const (
	BudgetTypeProductPricing = "ProductPricing"
	BudgetTypeSkuPricing     = "SkuPricing"
)

BudgetType constants represent the type of pricing for the budget.

View Source
const (
	Version = "v88.0.0"

	HeaderRateLimit     = "X-Ratelimit-Limit"
	HeaderRateRemaining = "X-Ratelimit-Remaining"
	HeaderRateReset     = "X-Ratelimit-Reset"
	HeaderRateResource  = "X-Ratelimit-Resource"
	HeaderRateUsed      = "X-Ratelimit-Used"
	HeaderRequestID     = "X-Github-Request-Id"
)
View Source
const (
	// BypassRateLimitCheck prevents a pre-emptive check for exceeded primary rate limits
	// Specify this by providing a context with this key, e.g.
	//   context.WithValue(context.Background(), github.BypassRateLimitCheck, true)
	BypassRateLimitCheck requestContext = iota

	SleepUntilPrimaryRateLimitResetWhenRateLimited
)
View Source
const (

	// SHA1SignatureHeader is the GitHub header key used to pass the HMAC-SHA1 hexdigest.
	SHA1SignatureHeader = "X-Hub-Signature"
	// SHA256SignatureHeader is the GitHub header key used to pass the HMAC-SHA256 hexdigest.
	SHA256SignatureHeader = "X-Hub-Signature-256"
	// EventTypeHeader is the GitHub header key used to pass the event type.
	EventTypeHeader = "X-Github-Event"
	// DeliveryIDHeader is the GitHub header key used to pass the unique ID for the webhook event.
	DeliveryIDHeader = "X-Github-Delivery"
)
View Source
const SCIMSchemasURINamespacesGroups = "urn:ietf:params:scim:schemas:core:2.0:Group"

SCIMSchemasURINamespacesGroups is the SCIM schema URI namespace for group resources. This constant represents the standard SCIM core schema for group objects as defined by RFC 7643.

View Source
const SCIMSchemasURINamespacesListResponse = "urn:ietf:params:scim:api:messages:2.0:ListResponse"

SCIMSchemasURINamespacesListResponse is the SCIM schema URI namespace for list response resources. This constant represents the standard SCIM namespace for list responses used in paginated queries, as defined by RFC 7644.

View Source
const SCIMSchemasURINamespacesPatchOp = "urn:ietf:params:scim:api:messages:2.0:PatchOp"

SCIMSchemasURINamespacesPatchOp is the SCIM schema URI namespace for patch operations. This constant represents the standard SCIM namespace for patch operations as defined by RFC 7644.

View Source
const SCIMSchemasURINamespacesUser = "urn:ietf:params:scim:schemas:core:2.0:User"

SCIMSchemasURINamespacesUser is the SCIM schema URI namespace for user resources. This constant represents the standard SCIM core schema for user objects as defined by RFC 7643.

Variables

View Source
var ErrBranchNotProtected = errors.New("branch is not protected")
View Source
var ErrContentsDirectory = errors.New("contents not available for directory")

ErrContentsDirectory indicates that the contents are not available for a directory.

View Source
var ErrContentsNoDownloadURL = errors.New("contents download url is empty")

ErrContentsNoDownloadURL indicates that the contents download URL is empty, which may occur when file size > 100 MB.

View Source
var ErrContentsSubmodule = errors.New("contents not available for submodule")

ErrContentsSubmodule indicates that the contents are not available for a submodule.

View Source
var ErrMixedCommentStyles = errors.New("cannot use both position and side/line form comments")
View Source
var ErrPathForbidden = errors.New("path must not contain '..' due to auth vulnerability issue")

ErrPathForbidden is returned when a URL path contains ".." as a path segment, which could allow path traversal attacks.

Functions

func Bool deprecated

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

Deprecated: use Ptr instead.

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range or equal to 202 Accepted. API error responses are expected to have response body, and a JSON response body that maps to ErrorResponse.

The error type will be *RateLimitError for rate limit exceeded errors, *AcceptedError for 202 Accepted status codes, *TwoFactorAuthError for two-factor authentication errors, and *RedirectionError for redirect status codes (only happens when ignoring redirections).

func DeliveryID

func DeliveryID(r *http.Request) string

DeliveryID returns the unique delivery ID of webhook request r.

GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/github-event-types

func EventForType

func EventForType(messageType string) any

EventForType returns an empty struct matching the specified GitHub event type. If messageType does not match any known event types, it returns nil.

func Int deprecated

func Int(v int) *int

Int is a helper routine that allocates a new int value to store v and returns a pointer to it.

Deprecated: use Ptr instead.

func Int64 deprecated

func Int64(v int64) *int64

Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it.

Deprecated: use Ptr instead.

func MessageTypes

func MessageTypes() []string

MessageTypes returns a sorted list of all the known GitHub event type strings supported by go-github.

func ParseWebHook

func ParseWebHook(messageType string, payload []byte) (any, error)

ParseWebHook parses the event payload. For recognized event types, a value of the corresponding struct type will be returned (as returned by Event.ParsePayload). An error will be returned for unrecognized event types.

Example usage:

func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	payload, err := github.ValidatePayload(r, s.webhookSecretKey)
	if err != nil { ... }
	event, err := github.ParseWebHook(github.WebHookType(r), payload)
	if err != nil { ... }
	switch event := event.(type) {
	case *github.CommitCommentEvent:
		processCommitCommentEvent(event)
	case *github.CreateEvent:
		processCreateEvent(event)
	...
	}
}

func Ptr

func Ptr[T any](v T) *T

Ptr is a helper routine that allocates a new T value to store v and returns a pointer to it.

func String deprecated

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

Deprecated: use Ptr instead.

func Stringify

func Stringify(message any) string

Stringify attempts to create a reasonable string representation of types in the GitHub library. It does things like resolve pointers to their values and omits struct fields with nil values.

func ValidatePayload

func ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err error)

ValidatePayload validates an incoming GitHub Webhook event request and returns the (JSON) payload. The Content-Type header of the payload can be "application/json" or "application/x-www-form-urlencoded". If the Content-Type is neither then an error is returned. secretToken is the GitHub Webhook secret token. If your webhook does not contain a secret token, you can pass nil or an empty slice. This is intended for local development purposes only and all webhooks should ideally set up a secret token.

Example usage:

func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	payload, err := github.ValidatePayload(r, s.webhookSecretKey)
	if err != nil { ... }
	// Process payload...
}

func ValidatePayloadFromBody

func ValidatePayloadFromBody(contentType string, readable io.Reader, signature string, secretToken []byte) (payload []byte, err error)

ValidatePayloadFromBody validates an incoming GitHub Webhook event request body and returns the (JSON) payload. The Content-Type header of the payload can be "application/json" or "application/x-www-form-urlencoded". If the Content-Type is neither then an error is returned. secretToken is the GitHub Webhook secret token. If your webhook does not contain a secret token, you can pass an empty secretToken. Webhooks without a secret token are not secure and should be avoided.

Example usage:

func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	// read signature from request
	signature := ""
	payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey)
	if err != nil { ... }
	// Process payload...
}

func ValidateSignature

func ValidateSignature(signature string, payload, secretToken []byte) error

ValidateSignature validates the signature for the given payload. signature is the GitHub hash signature delivered in the X-Hub-Signature header. payload is the JSON payload sent by GitHub Webhooks. secretToken is the GitHub Webhook secret token.

GitHub API docs: https://developer.github.com/webhooks/securing/#validating-payloads-from-github

func WebHookType

func WebHookType(r *http.Request) string

WebHookType returns the event type of webhook request r.

GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/github-event-types

Types

type APIMeta

type APIMeta struct {
	// An array of IP addresses in CIDR format specifying the addresses
	// that incoming service hooks will originate from on GitHub.com.
	Hooks []string `json:"hooks,omitempty"`

	// An array of IP addresses in CIDR format specifying the Git servers
	// for GitHub.com.
	Git []string `json:"git,omitempty"`

	// Whether authentication with username and password is supported.
	// (GitHub Enterprise instances using CAS or OAuth for authentication
	// will return false. Features like Basic Authentication with a
	// username and password, sudo mode, and two-factor authentication are
	// not supported on these servers.)
	VerifiablePasswordAuthentication *bool `json:"verifiable_password_authentication,omitempty"`

	// An array of IP addresses in CIDR format specifying the addresses
	// which serve GitHub Packages.
	Packages []string `json:"packages,omitempty"`

	// An array of IP addresses in CIDR format specifying the addresses
	// which serve GitHub Pages websites.
	Pages []string `json:"pages,omitempty"`

	// An array of IP addresses specifying the addresses that source imports
	// will originate from on GitHub.com.
	Importer []string `json:"importer,omitempty"`

	// An array of IP addresses specifying the addresses that source imports
	// will originate from on GitHub Enterprise Cloud.
	GithubEnterpriseImporter []string `json:"github_enterprise_importer,omitempty"`

	// An array of IP addresses in CIDR format specifying the IP addresses
	// GitHub Actions will originate from.
	Actions []string `json:"actions,omitempty"`

	// An array of IP addresses in CIDR format specifying the IP addresses
	// GitHub Action macOS runner will originate from.
	ActionsMacos []string `json:"actions_macos,omitempty"`

	// An array of IP addresses in CIDR format specifying the IP addresses
	// GitHub Codespaces will originate from.
	Codespaces []string `json:"codespaces,omitempty"`

	// An array of IP addresses in CIDR format specifying the IP addresses
	// GitHub Copilot will originate from.
	Copilot []string `json:"copilot,omitempty"`

	// An array of IP addresses in CIDR format specifying the IP addresses
	// Dependabot will originate from.
	Dependabot []string `json:"dependabot,omitempty"`

	// A map of algorithms to SSH key fingerprints.
	SSHKeyFingerprints map[string]string `json:"ssh_key_fingerprints,omitempty"`

	// An array of SSH keys.
	SSHKeys []string `json:"ssh_keys,omitempty"`

	// An array of IP addresses in CIDR format specifying the addresses
	// which serve GitHub websites.
	Web []string `json:"web,omitempty"`

	// An array of IP addresses in CIDR format specifying the addresses
	// which serve GitHub APIs.
	API []string `json:"api,omitempty"`

	// GitHub services and their associated domains. Note that many of these domains
	// are represented as wildcards (e.g. "*.github.com").
	Domains *APIMetaDomains `json:"domains,omitempty"`
}

APIMeta represents metadata about the GitHub API.

func (*APIMeta) GetAPI

func (a *APIMeta) GetAPI() []string

GetAPI returns the API slice if it's non-nil, nil otherwise.

func (*APIMeta) GetActions

func (a *APIMeta) GetActions() []string

GetActions returns the Actions slice if it's non-nil, nil otherwise.

func (*APIMeta) GetActionsMacos

func (a *APIMeta) GetActionsMacos() []string

GetActionsMacos returns the ActionsMacos slice if it's non-nil, nil otherwise.

func (*APIMeta) GetCodespaces

func (a *APIMeta) GetCodespaces() []string

GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise.

func (*APIMeta) GetCopilot

func (a *APIMeta) GetCopilot() []string

GetCopilot returns the Copilot slice if it's non-nil, nil otherwise.

func (*APIMeta) GetDependabot

func (a *APIMeta) GetDependabot() []string

GetDependabot returns the Dependabot slice if it's non-nil, nil otherwise.

func (*APIMeta) GetDomains

func (a *APIMeta) GetDomains() *APIMetaDomains

GetDomains returns the Domains field.

func (*APIMeta) GetGit

func (a *APIMeta) GetGit() []string

GetGit returns the Git slice if it's non-nil, nil otherwise.

func (*APIMeta) GetGithubEnterpriseImporter

func (a *APIMeta) GetGithubEnterpriseImporter() []string

GetGithubEnterpriseImporter returns the GithubEnterpriseImporter slice if it's non-nil, nil otherwise.

func (*APIMeta) GetHooks

func (a *APIMeta) GetHooks() []string

GetHooks returns the Hooks slice if it's non-nil, nil otherwise.

func (*APIMeta) GetImporter

func (a *APIMeta) GetImporter() []string

GetImporter returns the Importer slice if it's non-nil, nil otherwise.

func (*APIMeta) GetPackages

func (a *APIMeta) GetPackages() []string

GetPackages returns the Packages slice if it's non-nil, nil otherwise.

func (*APIMeta) GetPages

func (a *APIMeta) GetPages() []string

GetPages returns the Pages slice if it's non-nil, nil otherwise.

func (*APIMeta) GetSSHKeyFingerprints

func (a *APIMeta) GetSSHKeyFingerprints() map[string]string

GetSSHKeyFingerprints returns the SSHKeyFingerprints map if it's non-nil, an empty map otherwise.

func (*APIMeta) GetSSHKeys

func (a *APIMeta) GetSSHKeys() []string

GetSSHKeys returns the SSHKeys slice if it's non-nil, nil otherwise.

func (*APIMeta) GetVerifiablePasswordAuthentication

func (a *APIMeta) GetVerifiablePasswordAuthentication() bool

GetVerifiablePasswordAuthentication returns the VerifiablePasswordAuthentication field if it's non-nil, zero value otherwise.

func (*APIMeta) GetWeb

func (a *APIMeta) GetWeb() []string

GetWeb returns the Web slice if it's non-nil, nil otherwise.

type APIMetaArtifactAttestations

type APIMetaArtifactAttestations struct {
	TrustDomain string   `json:"trust_domain,omitempty"`
	Services    []string `json:"services,omitempty"`
}

APIMetaArtifactAttestations represents the artifact attestation services domains.

func (*APIMetaArtifactAttestations) GetServices

func (a *APIMetaArtifactAttestations) GetServices() []string

GetServices returns the Services slice if it's non-nil, nil otherwise.

func (*APIMetaArtifactAttestations) GetTrustDomain

func (a *APIMetaArtifactAttestations) GetTrustDomain() string

GetTrustDomain returns the TrustDomain field.

type APIMetaDomains

type APIMetaDomains struct {
	Website              []string                     `json:"website,omitempty"`
	Codespaces           []string                     `json:"codespaces,omitempty"`
	Copilot              []string                     `json:"copilot,omitempty"`
	Packages             []string                     `json:"packages,omitempty"`
	Actions              []string                     `json:"actions,omitempty"`
	ActionsInbound       *ActionsInboundDomains       `json:"actions_inbound,omitempty"`
	ArtifactAttestations *APIMetaArtifactAttestations `json:"artifact_attestations,omitempty"`
}

APIMetaDomains represents the domains associated with GitHub services.

func (*APIMetaDomains) GetActions

func (a *APIMetaDomains) GetActions() []string

GetActions returns the Actions slice if it's non-nil, nil otherwise.

func (*APIMetaDomains) GetActionsInbound

func (a *APIMetaDomains) GetActionsInbound() *ActionsInboundDomains

GetActionsInbound returns the ActionsInbound field.

func (*APIMetaDomains) GetArtifactAttestations

func (a *APIMetaDomains) GetArtifactAttestations() *APIMetaArtifactAttestations

GetArtifactAttestations returns the ArtifactAttestations field.

func (*APIMetaDomains) GetCodespaces

func (a *APIMetaDomains) GetCodespaces() []string

GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise.

func (*APIMetaDomains) GetCopilot

func (a *APIMetaDomains) GetCopilot() []string

GetCopilot returns the Copilot slice if it's non-nil, nil otherwise.

func (*APIMetaDomains) GetPackages

func (a *APIMetaDomains) GetPackages() []string

GetPackages returns the Packages slice if it's non-nil, nil otherwise.

func (*APIMetaDomains) GetWebsite

func (a *APIMetaDomains) GetWebsite() []string

GetWebsite returns the Website slice if it's non-nil, nil otherwise.

type AbuseRateLimitError

type AbuseRateLimitError struct {
	Response *http.Response // HTTP response that caused this error
	Message  string         `json:"message"` // error message

	// RetryAfter is provided with some abuse rate limit errors. If present,
	// it is the amount of time that the client should wait before retrying.
	// Otherwise, the client should try again later (after an unspecified amount of time).
	RetryAfter *time.Duration
}

AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the "documentation_url" field value equal to "https://docs.github.com/rest/overview/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits".

func (*AbuseRateLimitError) Error

func (r *AbuseRateLimitError) Error() string

func (*AbuseRateLimitError) GetMessage

func (a *AbuseRateLimitError) GetMessage() string

GetMessage returns the Message field.

func (*AbuseRateLimitError) GetRetryAfter

func (a *AbuseRateLimitError) GetRetryAfter() time.Duration

GetRetryAfter returns the RetryAfter field if it's non-nil, zero value otherwise.

func (*AbuseRateLimitError) Is

func (r *AbuseRateLimitError) Is(target error) bool

Is returns whether the provided error equals this error.

type AcceptedAssignment

type AcceptedAssignment struct {
	ID          *int64               `json:"id,omitempty"`
	Submitted   *bool                `json:"submitted,omitempty"`
	Passing     *bool                `json:"passing,omitempty"`
	CommitCount *int                 `json:"commit_count,omitempty"`
	Grade       *string              `json:"grade,omitempty"`
	Students    []*ClassroomUser     `json:"students,omitempty"`
	Repository  *Repository          `json:"repository,omitempty"`
	Assignment  *ClassroomAssignment `json:"assignment,omitempty"`
}

AcceptedAssignment represents a GitHub Classroom accepted assignment.

func (*AcceptedAssignment) GetAssignment

func (a *AcceptedAssignment) GetAssignment() *ClassroomAssignment

GetAssignment returns the Assignment field.

func (*AcceptedAssignment) GetCommitCount

func (a *AcceptedAssignment) GetCommitCount() int

GetCommitCount returns the CommitCount field if it's non-nil, zero value otherwise.

func (*AcceptedAssignment) GetGrade

func (a *AcceptedAssignment) GetGrade() string

GetGrade returns the Grade field if it's non-nil, zero value otherwise.

func (*AcceptedAssignment) GetID

func (a *AcceptedAssignment) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*AcceptedAssignment) GetPassing

func (a *AcceptedAssignment) GetPassing() bool

GetPassing returns the Passing field if it's non-nil, zero value otherwise.

func (*AcceptedAssignment) GetRepository

func (a *AcceptedAssignment) GetRepository() *Repository

GetRepository returns the Repository field.

func (*AcceptedAssignment) GetStudents

func (a *AcceptedAssignment) GetStudents() []*ClassroomUser

GetStudents returns the Students slice if it's non-nil, nil otherwise.

func (*AcceptedAssignment) GetSubmitted

func (a *AcceptedAssignment) GetSubmitted() bool

GetSubmitted returns the Submitted field if it's non-nil, zero value otherwise.

func (AcceptedAssignment) String

func (a AcceptedAssignment) String() string

type AcceptedError

type AcceptedError struct {
	// Raw contains the response body.
	Raw []byte
}

AcceptedError occurs when GitHub returns 202 Accepted response with an empty body, which means a job was scheduled on the GitHub side to process the information needed and cache it. Technically, 202 Accepted is not a real error, it's just used to indicate that results are not ready yet, but should be available soon. The request can be repeated after some time.

func (*AcceptedError) Error

func (*AcceptedError) Error() string

func (*AcceptedError) GetRaw

func (a *AcceptedError) GetRaw() []byte

GetRaw returns the Raw slice if it's non-nil, nil otherwise.

func (*AcceptedError) Is

func (ae *AcceptedError) Is(target error) bool

Is returns whether the provided error equals this error.

type AccessibleRepository

type AccessibleRepository struct {
	ID       int64  `json:"id"`
	Name     string `json:"name"`
	FullName string `json:"full_name"`
}

AccessibleRepository represents a repository that can be made accessible to a GitHub app.

func (*AccessibleRepository) GetFullName

func (a *AccessibleRepository) GetFullName() string

GetFullName returns the FullName field.

func (*AccessibleRepository) GetID

func (a *AccessibleRepository) GetID() int64

GetID returns the ID field.

func (*AccessibleRepository) GetName

func (a *AccessibleRepository) GetName() string

GetName returns the Name field.

type ActionsAllowed

type ActionsAllowed struct {
	GithubOwnedAllowed *bool    `json:"github_owned_allowed,omitempty"`
	VerifiedAllowed    *bool    `json:"verified_allowed,omitempty"`
	PatternsAllowed    []string `json:"patterns_allowed,omitempty"`
}

ActionsAllowed represents selected actions that are allowed.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28

func (*ActionsAllowed) GetGithubOwnedAllowed

func (a *ActionsAllowed) GetGithubOwnedAllowed() bool

GetGithubOwnedAllowed returns the GithubOwnedAllowed field if it's non-nil, zero value otherwise.

func (*ActionsAllowed) GetPatternsAllowed

func (a *ActionsAllowed) GetPatternsAllowed() []string

GetPatternsAllowed returns the PatternsAllowed slice if it's non-nil, nil otherwise.

func (*ActionsAllowed) GetVerifiedAllowed

func (a *ActionsAllowed) GetVerifiedAllowed() bool

GetVerifiedAllowed returns the VerifiedAllowed field if it's non-nil, zero value otherwise.

func (ActionsAllowed) String

func (a ActionsAllowed) String() string

type ActionsCache

type ActionsCache struct {
	ID             *int64     `json:"id,omitempty" url:"-"`
	Ref            *string    `json:"ref,omitempty" url:"ref"`
	Key            *string    `json:"key,omitempty" url:"key"`
	Version        *string    `json:"version,omitempty" url:"-"`
	LastAccessedAt *Timestamp `json:"last_accessed_at,omitempty" url:"-"`
	CreatedAt      *Timestamp `json:"created_at,omitempty" url:"-"`
	SizeInBytes    *int64     `json:"size_in_bytes,omitempty" url:"-"`
}

ActionsCache represents a GitHub action cache.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#about-the-cache-api

func (*ActionsCache) GetCreatedAt

func (a *ActionsCache) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*ActionsCache) GetID

func (a *ActionsCache) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*ActionsCache) GetKey

func (a *ActionsCache) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*ActionsCache) GetLastAccessedAt

func (a *ActionsCache) GetLastAccessedAt() Timestamp

GetLastAccessedAt returns the LastAccessedAt field if it's non-nil, zero value otherwise.

func (*ActionsCache) GetRef

func (a *ActionsCache) GetRef() string

GetRef returns the Ref field if it's non-nil, zero value otherwise.

func (*ActionsCache) GetSizeInBytes

func (a *ActionsCache) GetSizeInBytes() int64

GetSizeInBytes returns the SizeInBytes field if it's non-nil, zero value otherwise.

func (*ActionsCache) GetVersion

func (a *ActionsCache) GetVersion() string

GetVersion returns the Version field if it's non-nil, zero value otherwise.

type ActionsCacheList

type ActionsCacheList struct {
	TotalCount    int             `json:"total_count"`
	ActionsCaches []*ActionsCache `json:"actions_caches,omitempty"`
}

ActionsCacheList represents a list of GitHub actions Cache.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository

func (*ActionsCacheList) GetActionsCaches

func (a *ActionsCacheList) GetActionsCaches() []*ActionsCache

GetActionsCaches returns the ActionsCaches slice if it's non-nil, nil otherwise.

func (*ActionsCacheList) GetTotalCount

func (a *ActionsCacheList) GetTotalCount() int

GetTotalCount returns the TotalCount field.

type ActionsCacheListOptions

type ActionsCacheListOptions struct {
	ListOptions
	// The Git reference for the results you want to list.
	// The ref for a branch can be formatted either as refs/heads/<branch name>
	// or simply <branch name>. To reference a pull request use refs/pull/<number>/merge
	Ref *string `url:"ref,omitempty"`
	Key *string `url:"key,omitempty"`
	// Can be one of: "created_at", "last_accessed_at", "size_in_bytes". Default: "last_accessed_at"
	Sort *string `url:"sort,omitempty"`
	// Can be one of: "asc", "desc" Default: desc
	Direction *string `url:"direction,omitempty"`
}

ActionsCacheListOptions represents a list of all possible optional Query parameters for ListCaches method.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository

func (*ActionsCacheListOptions) GetDirection

func (a *ActionsCacheListOptions) GetDirection() string

GetDirection returns the Direction field if it's non-nil, zero value otherwise.

func (*ActionsCacheListOptions) GetKey

func (a *ActionsCacheListOptions) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*ActionsCacheListOptions) GetRef

func (a *ActionsCacheListOptions) GetRef() string

GetRef returns the Ref field if it's non-nil, zero value otherwise.

func (*ActionsCacheListOptions) GetSort

func (a *ActionsCacheListOptions) GetSort() string

GetSort returns the Sort field if it's non-nil, zero value otherwise.

type ActionsCacheUsage

type ActionsCacheUsage struct {
	FullName                string `json:"full_name"`
	ActiveCachesSizeInBytes int64  `json:"active_caches_size_in_bytes"`
	ActiveCachesCount       int    `json:"active_caches_count"`
}

ActionsCacheUsage represents a GitHub Actions Cache Usage object.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository

func (*ActionsCacheUsage) GetActiveCachesCount

func (a *ActionsCacheUsage) GetActiveCachesCount() int

GetActiveCachesCount returns the ActiveCachesCount field.

func (*ActionsCacheUsage) GetActiveCachesSizeInBytes

func (a *ActionsCacheUsage) GetActiveCachesSizeInBytes() int64

GetActiveCachesSizeInBytes returns the ActiveCachesSizeInBytes field.

func (*ActionsCacheUsage) GetFullName

func (a *ActionsCacheUsage) GetFullName() string

GetFullName returns the FullName field.

type ActionsCacheUsageList

type ActionsCacheUsageList struct {
	TotalCount     int                  `json:"total_count"`
	RepoCacheUsage []*ActionsCacheUsage `json:"repository_cache_usages,omitempty"`
}

ActionsCacheUsageList represents a list of repositories with GitHub Actions cache usage for an organization.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository

func (*ActionsCacheUsageList) GetRepoCacheUsage

func (a *ActionsCacheUsageList) GetRepoCacheUsage() []*ActionsCacheUsage

GetRepoCacheUsage returns the RepoCacheUsage slice if it's non-nil, nil otherwise.

func (*ActionsCacheUsageList) GetTotalCount

func (a *ActionsCacheUsageList) GetTotalCount() int

GetTotalCount returns the TotalCount field.

type ActionsEnabledOnEnterpriseRepos

type ActionsEnabledOnEnterpriseRepos struct {
	TotalCount    int             `json:"total_count"`
	Organizations []*Organization `json:"organizations"`
}

ActionsEnabledOnEnterpriseRepos represents all the repositories in an enterprise for which Actions is enabled.

func (*ActionsEnabledOnEnterpriseRepos) GetOrganizations

func (a *ActionsEnabledOnEnterpriseRepos) GetOrganizations() []*Organization

GetOrganizations returns the Organizations slice if it's non-nil, nil otherwise.

func (*ActionsEnabledOnEnterpriseRepos) GetTotalCount

func (a *ActionsEnabledOnEnterpriseRepos) GetTotalCount() int

GetTotalCount returns the TotalCount field.

type ActionsEnabledOnOrgRepos

type ActionsEnabledOnOrgRepos struct {
	TotalCount   int           `json:"total_count"`
	Repositories []*Repository `json:"repositories"`
}

ActionsEnabledOnOrgRepos represents all the repositories in an organization for which Actions is enabled.

func (*ActionsEnabledOnOrgRepos) GetRepositories

func (a *ActionsEnabledOnOrgRepos) GetRepositories() []*Repository

GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.

func (*ActionsEnabledOnOrgRepos) GetTotalCount

func (a *ActionsEnabledOnOrgRepos) GetTotalCount() int

GetTotalCount returns the TotalCount field.

type ActionsInboundDomains

type ActionsInboundDomains struct {
	FullDomains     []string `json:"full_domains,omitempty"`
	WildcardDomains []string `json:"wildcard_domains,omitempty"`
}

ActionsInboundDomains represents the domains associated with GitHub Actions inbound traffic.

func (*ActionsInboundDomains) GetFullDomains

func (a *ActionsInboundDomains) GetFullDomains() []string

GetFullDomains returns the FullDomains slice if it's non-nil, nil otherwise.

func (*ActionsInboundDomains) GetWildcardDomains

func (a *ActionsInboundDomains) GetWildcardDomains() []string

GetWildcardDomains returns the WildcardDomains slice if it's non-nil, nil otherwise.

type ActionsPermissions

type ActionsPermissions struct {
	EnabledRepositories *string `json:"enabled_repositories,omitempty"`
	AllowedActions      *string `json:"allowed_actions,omitempty"`
	SelectedActionsURL  *string `json:"selected_actions_url,omitempty"`
	SHAPinningRequired  *bool   `json:"sha_pinning_required,omitempty"`
}

ActionsPermissions represents a policy for repositories and allowed actions in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28

func (*ActionsPermissions) GetAllowedActions

func (a *ActionsPermissions) GetAllowedActions() string

GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise.

func (*ActionsPermissions) GetEnabledRepositories

func (a *ActionsPermissions) GetEnabledRepositories() string

GetEnabledRepositories returns the EnabledRepositories field if it's non-nil, zero value otherwise.

func (*ActionsPermissions) GetSHAPinningRequired

func (a *ActionsPermissions) GetSHAPinningRequired() bool

GetSHAPinningRequired returns the SHAPinningRequired field if it's non-nil, zero value otherwise.

func (*ActionsPermissions) GetSelectedActionsURL

func (a *ActionsPermissions) GetSelectedActionsURL() string

GetSelectedActionsURL returns the SelectedActionsURL field if it's non-nil, zero value otherwise.

func (ActionsPermissions) String

func (a ActionsPermissions) String() string

type ActionsPermissionsEnterprise

type ActionsPermissionsEnterprise struct {
	EnabledOrganizations *string `json:"enabled_organizations,omitempty"`
	AllowedActions       *string `json:"allowed_actions,omitempty"`
	SelectedActionsURL   *string `json:"selected_actions_url,omitempty"`
}

ActionsPermissionsEnterprise represents a policy for allowed actions in an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28

func (*ActionsPermissionsEnterprise) GetAllowedActions

func (a *ActionsPermissionsEnterprise) GetAllowedActions() string

GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise.

func (*ActionsPermissionsEnterprise) GetEnabledOrganizations

func (a *ActionsPermissionsEnterprise) GetEnabledOrganizations() string

GetEnabledOrganizations returns the EnabledOrganizations field if it's non-nil, zero value otherwise.

func (*ActionsPermissionsEnterprise) GetSelectedActionsURL

func (a *ActionsPermissionsEnterprise) GetSelectedActionsURL() string

GetSelectedActionsURL returns the SelectedActionsURL field if it's non-nil, zero value otherwise.

func (ActionsPermissionsEnterprise) String

type ActionsPermissionsRepository

type ActionsPermissionsRepository struct {
	Enabled            *bool   `json:"enabled,omitempty"`
	AllowedActions     *string `json:"allowed_actions,omitempty"`
	SelectedActionsURL *string `json:"selected_actions_url,omitempty"`
	SHAPinningRequired *bool   `json:"sha_pinning_required,omitempty"`
}

ActionsPermissionsRepository represents a policy for repositories and allowed actions in a repository.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28

func (*ActionsPermissionsRepository) GetAllowedActions

func (a *ActionsPermissionsRepository) GetAllowedActions() string

GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise.

func (*ActionsPermissionsRepository) GetEnabled

func (a *ActionsPermissionsRepository) GetEnabled() bool

GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.

func (*ActionsPermissionsRepository) GetSHAPinningRequired

func (a *ActionsPermissionsRepository) GetSHAPinningRequired() bool

GetSHAPinningRequired returns the SHAPinningRequired field if it's non-nil, zero value otherwise.

func (*ActionsPermissionsRepository) GetSelectedActionsURL

func (a *ActionsPermissionsRepository) GetSelectedActionsURL() string

GetSelectedActionsURL returns the SelectedActionsURL field if it's non-nil, zero value otherwise.

func (ActionsPermissionsRepository) String

type ActionsService

type ActionsService service

ActionsService handles communication with the actions related methods of the GitHub API.

GitHub API docs: https://docs.github.com/rest/actions?apiVersion=2022-11-28

func (*ActionsService) AddEnabledOrgInEnterprise

func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error)

AddEnabledOrgInEnterprise adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#enable-a-selected-organization-for-github-actions-in-an-enterprise

func (*ActionsService) AddEnabledReposInOrg

func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error)

AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#enable-a-selected-repository-for-github-actions-in-an-organization

func (*ActionsService) AddRepositoryAccessRunnerGroup

func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error)

AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have visibility set to 'selected'.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-repository-access-to-a-self-hosted-runner-group-in-an-organization

func (*ActionsService) AddRepositorySelfHostedRunnersAllowedInOrganization

func (s *ActionsService) AddRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryID int64) (*Response, error)

AddRepositorySelfHostedRunnersAllowedInOrganization adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#add-a-repository-to-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization

func (*ActionsService) AddRunnerGroupRunners

func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error)

AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-a-self-hosted-runner-to-a-group-for-an-organization

func (*ActionsService) AddSelectedRepoToOrgSecret

func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error)

AddSelectedRepoToOrgSecret adds a repository to an organization secret.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret

func (*ActionsService) AddSelectedRepoToOrgVariable

func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error)

AddSelectedRepoToOrgVariable adds a repository to an organization variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#add-selected-repository-to-an-organization-variable

func (*ActionsService) CancelWorkflowRunByID

func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error)

CancelWorkflowRunByID cancels a workflow run by ID. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#cancel-a-workflow-run

func (*ActionsService) CreateEnvVariable

func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error)

CreateEnvVariable creates an environment variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-an-environment-variable

func (*ActionsService) CreateHostedRunner

func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, request CreateHostedRunnerRequest) (*HostedRunner, *Response, error)

CreateHostedRunner creates a GitHub-hosted runner for an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#create-a-github-hosted-runner-for-an-organization

func (*ActionsService) CreateOrUpdateEnvSecret

func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error)

CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value.

GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#create-or-update-an-environment-secret

func (*ActionsService) CreateOrUpdateOrgSecret

func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error)

CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret

func (*ActionsService) CreateOrUpdateRepoSecret

func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error)

CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret

func (*ActionsService) CreateOrgVariable

func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error)

CreateOrgVariable creates an organization variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-an-organization-variable

func (*ActionsService) CreateOrganizationRegistrationToken

func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, org string) (*RegistrationToken, *Response, error)

CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner to an organization.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization

func (*ActionsService) CreateOrganizationRemoveToken

func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, org string) (*RemoveToken, *Response, error)

CreateOrganizationRemoveToken creates a token that can be used to remove a self-hosted runner from an organization.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-remove-token-for-an-organization

func (*ActionsService) CreateOrganizationRunnerGroup

func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error)

CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#create-a-self-hosted-runner-group-for-an-organization

func (*ActionsService) CreateRegistrationToken

func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error)

CreateRegistrationToken creates a token that can be used to add a self-hosted runner.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository

func (*ActionsService) CreateRemoveToken

func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error)

CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-remove-token-for-a-repository

func (*ActionsService) CreateRepoVariable

func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error)

CreateRepoVariable creates a repository variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-a-repository-variable

func (*ActionsService) CreateWorkflowDispatchEventByFileName

func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error)

CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run.

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event

func (*ActionsService) CreateWorkflowDispatchEventByID

func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error)

CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run.

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event

func (*ActionsService) DeleteArtifact

func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error)

DeleteArtifact deletes a workflow run artifact.

GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#delete-an-artifact

func (*ActionsService) DeleteCachesByID

func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error)

DeleteCachesByID deletes a GitHub Actions cache for a repository, using a cache ID.

Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id

func (*ActionsService) DeleteCachesByKey

func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key string, ref *string) (*Response, error)

DeleteCachesByKey deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. The ref for a branch can be formatted either as "refs/heads/<branch name>" or simply "<branch name>". To reference a pull request use "refs/pull/<number>/merge". If you don't want to use ref just pass nil in parameter.

Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key

func (*ActionsService) DeleteEnvSecret

func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error)

DeleteEnvSecret deletes a secret in an environment using the secret name.

GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#delete-an-environment-secret

func (*ActionsService) DeleteEnvVariable

func (s *ActionsService) DeleteEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*Response, error)

DeleteEnvVariable deletes a variable in an environment.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#delete-an-environment-variable

func (*ActionsService) DeleteHostedRunner

func (s *ActionsService) DeleteHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error)

DeleteHostedRunner deletes GitHub-hosted runner from an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-a-github-hosted-runner-for-an-organization

func (*ActionsService) DeleteHostedRunnerCustomImage

func (s *ActionsService) DeleteHostedRunnerCustomImage(ctx context.Context, org string, imageDefinitionID int64) (*Response, error)

DeleteHostedRunnerCustomImage deletes a custom image from the organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-a-custom-image-from-the-organization

func (*ActionsService) DeleteHostedRunnerCustomImageVersion

func (s *ActionsService) DeleteHostedRunnerCustomImageVersion(ctx context.Context, org string, imageDefinitionID int64, version string) (*Response, error)

DeleteHostedRunnerCustomImageVersion deletes an image version of a custom image from the organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-an-image-version-of-custom-image-from-the-organization

func (*ActionsService) DeleteOrgSecret

func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error)

DeleteOrgSecret deletes a secret in an organization using the secret name.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#delete-an-organization-secret

func (*ActionsService) DeleteOrgVariable

func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string) (*Response, error)

DeleteOrgVariable deletes a variable in an organization.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#delete-an-organization-variable

func (*ActionsService) DeleteOrganizationRunnerGroup

func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error)

DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#delete-a-self-hosted-runner-group-from-an-organization

func (*ActionsService) DeleteRepoSecret

func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error)

DeleteRepoSecret deletes a secret in a repository using the secret name.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#delete-a-repository-secret

func (*ActionsService) DeleteRepoVariable

func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, name string) (*Response, error)

DeleteRepoVariable deletes a variable in a repository.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#delete-a-repository-variable

func (*ActionsService) DeleteWorkflowRun

func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error)

DeleteWorkflowRun deletes a workflow run by ID. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#delete-a-workflow-run

func (*ActionsService) DeleteWorkflowRunLogs

func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64) (*Response, error)

DeleteWorkflowRunLogs deletes all logs for a workflow run. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#delete-workflow-run-logs

func (*ActionsService) DisableWorkflowByFileName

func (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error)

DisableWorkflowByFileName disables a workflow and sets the state of the workflow to "disabled_manually".

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#disable-a-workflow

func (*ActionsService) DisableWorkflowByID

func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error)

DisableWorkflowByID disables a workflow and sets the state of the workflow to "disabled_manually".

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#disable-a-workflow

func (*ActionsService) DownloadArtifact

func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error)

DownloadArtifact gets a redirect URL to download an archive for a repository.

GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact

func (*ActionsService) EnableWorkflowByFileName

func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error)

EnableWorkflowByFileName enables a workflow and sets the state of the workflow to "active".

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#enable-a-workflow

func (*ActionsService) EnableWorkflowByID

func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error)

EnableWorkflowByID enables a workflow and sets the state of the workflow to "active".

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#enable-a-workflow

func (*ActionsService) GenerateOrgJITConfig

func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, org string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error)

GenerateOrgJITConfig generate a just-in-time configuration for an organization.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-organization

func (*ActionsService) GenerateRepoJITConfig

func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error)

GenerateRepoJITConfig generates a just-in-time configuration for a repository.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-a-repository

func (*ActionsService) GetActionsAllowed

func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error)

GetActionsAllowed gets the actions that are allowed in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-allowed-actions-and-reusable-workflows-for-an-organization

func (*ActionsService) GetActionsAllowedInEnterprise

func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, enterprise string) (*ActionsAllowed, *Response, error)

GetActionsAllowedInEnterprise gets the actions that are allowed in an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-allowed-actions-and-reusable-workflows-for-an-enterprise

func (*ActionsService) GetActionsPermissions

func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error)

GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-github-actions-permissions-for-an-organization

func (*ActionsService) GetActionsPermissionsInEnterprise

func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, enterprise string) (*ActionsPermissionsEnterprise, *Response, error)

GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy for an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-github-actions-permissions-for-an-enterprise

func (*ActionsService) GetArtifact

func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error)

GetArtifact gets a specific artifact for a workflow run.

GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#get-an-artifact

func (*ActionsService) GetArtifactAndLogRetentionPeriodInEnterprise

func (s *ActionsService) GetArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string) (*ArtifactPeriod, *Response, error)

GetArtifactAndLogRetentionPeriodInEnterprise gets the artifact and log retention period for an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-artifact-and-log-retention-settings-for-an-enterprise

func (*ActionsService) GetArtifactAndLogRetentionPeriodInOrganization

func (s *ActionsService) GetArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string) (*ArtifactPeriod, *Response, error)

GetArtifactAndLogRetentionPeriodInOrganization gets the artifact and log retention period for an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-artifact-and-log-retention-settings-for-an-organization

func (*ActionsService) GetCacheUsageForRepo

func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error)

GetCacheUsageForRepo gets GitHub Actions cache usage for a repository. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

Permissions: Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository

func (*ActionsService) GetDefaultWorkflowPermissionsInEnterprise

func (s *ActionsService) GetDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string) (*DefaultWorkflowPermissionEnterprise, *Response, error)

GetDefaultWorkflowPermissionsInEnterprise gets the GitHub Actions default workflow permissions for an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-default-workflow-permissions-for-an-enterprise

func (*ActionsService) GetDefaultWorkflowPermissionsInOrganization

func (s *ActionsService) GetDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string) (*DefaultWorkflowPermissionOrganization, *Response, error)

GetDefaultWorkflowPermissionsInOrganization gets the GitHub Actions default workflow permissions for an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-default-workflow-permissions-for-an-organization

func (*ActionsService) GetEnterpriseForkPRContributorApprovalPermissions

func (s *ActionsService) GetEnterpriseForkPRContributorApprovalPermissions(ctx context.Context, enterprise string) (*ContributorApprovalPermissions, *Response, error)

GetEnterpriseForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-fork-pr-contributor-approval-permissions-for-an-enterprise

func (*ActionsService) GetEnvPublicKey

func (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error)

GetEnvPublicKey gets a public key that should be used for secret encryption.

GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-public-key

func (*ActionsService) GetEnvSecret

func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error)

GetEnvSecret gets a single environment secret without revealing its encrypted value.

GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-secret

func (*ActionsService) GetEnvVariable

func (s *ActionsService) GetEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*ActionsVariable, *Response, error)

GetEnvVariable gets a single environment variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#get-an-environment-variable

func (*ActionsService) GetForkPRContributorApprovalPermissions

func (s *ActionsService) GetForkPRContributorApprovalPermissions(ctx context.Context, owner, repo string) (*ContributorApprovalPermissions, *Response, error)

GetForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for a repository.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-fork-pr-contributor-approval-permissions-for-a-repository

func (*ActionsService) GetHostedRunner

func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error)

GetHostedRunner gets a GitHub-hosted runner in an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-a-github-hosted-runner-for-an-organization

func (*ActionsService) GetHostedRunnerCustomImage

func (s *ActionsService) GetHostedRunnerCustomImage(ctx context.Context, org string, imageDefinitionID int64) (*HostedRunnerCustomImage, *Response, error)

GetHostedRunnerCustomImage gets a custom image definition for GitHub-hosted runners in an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-a-custom-image-definition-for-github-actions-hosted-runners

func (*ActionsService) GetHostedRunnerCustomImageVersion

func (s *ActionsService) GetHostedRunnerCustomImageVersion(ctx context.Context, org string, imageDefinitionID int64, version string) (*HostedRunnerCustomImageVersion, *Response, error)

GetHostedRunnerCustomImageVersion gets an image version of a custom image for GitHub-hosted runners in an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-an-image-version-of-a-custom-image-for-github-actions-hosted-runners

func (*ActionsService) GetHostedRunnerGitHubOwnedImages

func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error)

GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-github-owned-images-for-github-hosted-runners-in-an-organization

func (*ActionsService) GetHostedRunnerLimits

func (s *ActionsService) GetHostedRunnerLimits(ctx context.Context, org string) (*HostedRunnerPublicIPLimits, *Response, error)

GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-limits-on-github-hosted-runners-for-an-organization

func (*ActionsService) GetHostedRunnerMachineSpecs

func (s *ActionsService) GetHostedRunnerMachineSpecs(ctx context.Context, org string) (*HostedRunnerMachineSpecs, *Response, error)

GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-github-hosted-runners-machine-specs-for-an-organization

func (*ActionsService) GetHostedRunnerPartnerImages

func (s *ActionsService) GetHostedRunnerPartnerImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error)

GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-partner-images-for-github-hosted-runners-in-an-organization

func (*ActionsService) GetHostedRunnerPlatforms

func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org string) (*HostedRunnerPlatforms, *Response, error)

GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-platforms-for-github-hosted-runners-in-an-organization

func (*ActionsService) GetOrgOIDCSubjectClaimCustomTemplate

func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string) (*OIDCSubjectClaimCustomTemplate, *Response, error)

GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization.

GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization

func (*ActionsService) GetOrgPublicKey

func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error)

GetOrgPublicKey gets a public key that should be used for secret encryption.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-an-organization-public-key

func (*ActionsService) GetOrgSecret

func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error)

GetOrgSecret gets a single organization secret without revealing its encrypted value.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-an-organization-secret

func (*ActionsService) GetOrgVariable

func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) (*ActionsVariable, *Response, error)

GetOrgVariable gets a single organization variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#get-an-organization-variable

func (*ActionsService) GetOrganizationForkPRContributorApprovalPermissions

func (s *ActionsService) GetOrganizationForkPRContributorApprovalPermissions(ctx context.Context, org string) (*ContributorApprovalPermissions, *Response, error)

GetOrganizationForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-fork-pr-contributor-approval-permissions-for-an-organization

func (*ActionsService) GetOrganizationRunner

func (s *ActionsService) GetOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Runner, *Response, error)

GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-an-organization

func (*ActionsService) GetOrganizationRunnerGroup

func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error)

GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#get-a-self-hosted-runner-group-for-an-organization

func (*ActionsService) GetPendingDeployments

func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo string, runID int64) ([]*PendingDeployment, *Response, error)

GetPendingDeployments get all deployment environments for a workflow run that are waiting for protection rules to pass. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-pending-deployments-for-a-workflow-run

func (*ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise

func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string) (*WorkflowsPermissions, *Response, error)

GetPrivateRepoForkPRWorkflowSettingsInEnterprise gets the settings for whether workflows from fork pull requests can run on private repositories in an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-private-repo-fork-pr-workflow-settings-for-an-enterprise

func (*ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization

func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string) (*WorkflowsPermissions, *Response, error)

GetPrivateRepoForkPRWorkflowSettingsInOrganization gets the settings for whether workflows from fork pull requests can run on private repositories in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-private-repo-fork-pr-workflow-settings-for-an-organization

func (*ActionsService) GetRepoOIDCSubjectClaimCustomTemplate

func (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string) (*OIDCSubjectClaimCustomTemplate, *Response, error)

GetRepoOIDCSubjectClaimCustomTemplate gets the subject claim customization template for a repository.

GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository

func (*ActionsService) GetRepoPublicKey

func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error)

GetRepoPublicKey gets a public key that should be used for secret encryption.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-a-repository-public-key

func (*ActionsService) GetRepoSecret

func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error)

GetRepoSecret gets a single repository secret without revealing its encrypted value.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-a-repository-secret

func (*ActionsService) GetRepoVariable

func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name string) (*ActionsVariable, *Response, error)

GetRepoVariable gets a single repository variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#get-a-repository-variable

func (*ActionsService) GetRunner

func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error)

GetRunner gets a specific self-hosted runner for a repository using its runner ID.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-a-repository

func (*ActionsService) GetSelfHostedRunnerPermissionsInEnterprise

func (s *ActionsService) GetSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string) (*SelfHostRunnerPermissionsEnterprise, *Response, error)

GetSelfHostedRunnerPermissionsInEnterprise gets the self-hosted runner permissions for an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-self-hosted-runners-permissions-for-an-enterprise

func (*ActionsService) GetSelfHostedRunnersSettingsInOrganization

func (s *ActionsService) GetSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string) (*SelfHostedRunnersSettingsOrganization, *Response, error)

GetSelfHostedRunnersSettingsInOrganization gets the self-hosted runners permissions settings for repositories in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-self-hosted-runners-settings-for-an-organization

func (*ActionsService) GetTotalCacheUsageForEnterprise

func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error)

GetTotalCacheUsageForEnterprise gets the total GitHub Actions cache usage for an enterprise. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

Permissions: You must authenticate using an access token with the "admin:enterprise" scope to use this endpoint.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise

func (*ActionsService) GetTotalCacheUsageForOrg

func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error)

GetTotalCacheUsageForOrg gets the total GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. GitHub Apps must have the organization_administration:read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-organization

func (*ActionsService) GetWorkflowByFileName

func (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Workflow, *Response, error)

GetWorkflowByFileName gets a specific workflow by file name.

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-a-workflow

func (*ActionsService) GetWorkflowByID

func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Workflow, *Response, error)

GetWorkflowByID gets a specific workflow by ID.

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-a-workflow

func (*ActionsService) GetWorkflowJobByID

func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error)

GetWorkflowJobByID gets a specific job in a workflow run by ID.

GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#get-a-job-for-a-workflow-run

func (*ActionsService) GetWorkflowJobLogs

func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, maxRedirects int) (*url.URL, *Response, error)

GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job.

GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#download-job-logs-for-a-workflow-run

func (*ActionsService) GetWorkflowRunAttempt

func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo string, runID int64, attemptNumber int, opts *WorkflowRunAttemptOptions) (*WorkflowRun, *Response, error)

GetWorkflowRunAttempt gets a specific workflow run attempt. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run-attempt

func (*ActionsService) GetWorkflowRunAttemptLogs

func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber, maxRedirects int) (*url.URL, *Response, error)

GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve a workflow run ID from the DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#download-workflow-run-attempt-logs

func (*ActionsService) GetWorkflowRunByID

func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error)

GetWorkflowRunByID gets a specific workflow run by ID. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run

func (*ActionsService) GetWorkflowRunLogs

func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, maxRedirects int) (*url.URL, *Response, error)

GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#download-workflow-run-logs

func (*ActionsService) GetWorkflowRunUsageByID

func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRunUsage, *Response, error)

GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-workflow-run-usage

func (*ActionsService) GetWorkflowUsageByFileName

func (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, repo, workflowFileName string) (*WorkflowUsage, *Response, error)

GetWorkflowUsageByFileName gets a specific workflow usage by file name in the unit of billable milliseconds.

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-workflow-usage

func (*ActionsService) GetWorkflowUsageByID

func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo string, workflowID int64) (*WorkflowUsage, *Response, error)

GetWorkflowUsageByID gets a specific workflow usage by ID in the unit of billable milliseconds.

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-workflow-usage

func (*ActionsService) ListArtifacts

func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListArtifactsOptions) (*ArtifactList, *Response, error)

ListArtifacts lists all artifacts that belong to a repository.

GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#list-artifacts-for-a-repository

func (*ActionsService) ListArtifactsIter

func (s *ActionsService) ListArtifactsIter(ctx context.Context, owner string, repo string, opts *ListArtifactsOptions) iter.Seq2[*Artifact, error]

ListArtifactsIter returns an iterator that paginates through all results of ListArtifacts.

func (*ActionsService) ListCacheUsageByRepoForOrg

func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org string, opts *ListOptions) (*ActionsCacheUsageList, *Response, error)

ListCacheUsageByRepoForOrg lists repositories and their GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. GitHub Apps must have the organization_administration:read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-repositories-with-github-actions-cache-usage-for-an-organization

func (*ActionsService) ListCacheUsageByRepoForOrgIter

func (s *ActionsService) ListCacheUsageByRepoForOrgIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*ActionsCacheUsage, error]

ListCacheUsageByRepoForOrgIter returns an iterator that paginates through all results of ListCacheUsageByRepoForOrg.

func (*ActionsService) ListCaches

func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opts *ActionsCacheListOptions) (*ActionsCacheList, *Response, error)

ListCaches lists the GitHub Actions caches for a repository. You must authenticate using an access token with the repo scope to use this endpoint.

Permissions: must have the actions:read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository

func (*ActionsService) ListCachesIter

func (s *ActionsService) ListCachesIter(ctx context.Context, owner string, repo string, opts *ActionsCacheListOptions) iter.Seq2[*ActionsCache, error]

ListCachesIter returns an iterator that paginates through all results of ListCaches.

func (*ActionsService) ListEnabledOrgsInEnterprise

func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnEnterpriseRepos, *Response, error)

ListEnabledOrgsInEnterprise lists the selected organizations that are enabled for GitHub Actions in an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#list-selected-organizations-enabled-for-github-actions-in-an-enterprise

func (*ActionsService) ListEnabledOrgsInEnterpriseIter

func (s *ActionsService) ListEnabledOrgsInEnterpriseIter(ctx context.Context, owner string, opts *ListOptions) iter.Seq2[*Organization, error]

ListEnabledOrgsInEnterpriseIter returns an iterator that paginates through all results of ListEnabledOrgsInEnterprise.

func (*ActionsService) ListEnabledReposInOrg

func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error)

ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#list-selected-repositories-enabled-for-github-actions-in-an-organization

func (*ActionsService) ListEnabledReposInOrgIter

func (s *ActionsService) ListEnabledReposInOrgIter(ctx context.Context, owner string, opts *ListOptions) iter.Seq2[*Repository, error]

ListEnabledReposInOrgIter returns an iterator that paginates through all results of ListEnabledReposInOrg.

func (*ActionsService) ListEnvSecrets

func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error)

ListEnvSecrets lists all secrets available in an environment.

GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#list-environment-secrets

func (*ActionsService) ListEnvSecretsIter

func (s *ActionsService) ListEnvSecretsIter(ctx context.Context, repoID int, env string, opts *ListOptions) iter.Seq2[*Secret, error]

ListEnvSecretsIter returns an iterator that paginates through all results of ListEnvSecrets.

func (*ActionsService) ListEnvVariables

func (s *ActionsService) ListEnvVariables(ctx context.Context, owner, repo, env string, opts *ListOptions) (*ActionsVariables, *Response, error)

ListEnvVariables lists all variables available in an environment.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-environment-variables

func (*ActionsService) ListEnvVariablesIter

func (s *ActionsService) ListEnvVariablesIter(ctx context.Context, owner string, repo string, env string, opts *ListOptions) iter.Seq2[*ActionsVariable, error]

ListEnvVariablesIter returns an iterator that paginates through all results of ListEnvVariables.

func (*ActionsService) ListHostedRunnerCustomImageVersions

func (s *ActionsService) ListHostedRunnerCustomImageVersions(ctx context.Context, org string, imageDefinitionID int64) (*HostedRunnerCustomImageVersions, *Response, error)

ListHostedRunnerCustomImageVersions lists image versions of a custom image for an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#list-image-versions-of-a-custom-image-for-an-organization

func (*ActionsService) ListHostedRunnerCustomImages

func (s *ActionsService) ListHostedRunnerCustomImages(ctx context.Context, org string) (*HostedRunnerCustomImages, *Response, error)

ListHostedRunnerCustomImages lists custom images for GitHub-hosted runners in an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#list-custom-images-for-an-organization

func (*ActionsService) ListHostedRunners

func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts *ListOptions) (*HostedRunners, *Response, error)

ListHostedRunners lists all the GitHub-hosted runners for an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#list-github-hosted-runners-for-an-organization

func (*ActionsService) ListHostedRunnersIter

func (s *ActionsService) ListHostedRunnersIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*HostedRunner, error]

ListHostedRunnersIter returns an iterator that paginates through all results of ListHostedRunners.

func (*ActionsService) ListOrgSecrets

func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error)

ListOrgSecrets lists all secrets available in an organization without revealing their encrypted values.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-organization-secrets

func (*ActionsService) ListOrgSecretsIter

func (s *ActionsService) ListOrgSecretsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Secret, error]

ListOrgSecretsIter returns an iterator that paginates through all results of ListOrgSecrets.

func (*ActionsService) ListOrgVariables

func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts *ListOptions) (*ActionsVariables, *Response, error)

ListOrgVariables lists all variables available in an organization.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-organization-variables

func (*ActionsService) ListOrgVariablesIter

func (s *ActionsService) ListOrgVariablesIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*ActionsVariable, error]

ListOrgVariablesIter returns an iterator that paginates through all results of ListOrgVariables.

func (*ActionsService) ListOrganizationRunnerApplicationDownloads

func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, org string) ([]*RunnerApplicationDownload, *Response, error)

ListOrganizationRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization

func (*ActionsService) ListOrganizationRunnerGroups

func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error)

ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runner-groups-for-an-organization

func (*ActionsService) ListOrganizationRunnerGroupsIter

func (s *ActionsService) ListOrganizationRunnerGroupsIter(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) iter.Seq2[*RunnerGroup, error]

ListOrganizationRunnerGroupsIter returns an iterator that paginates through all results of ListOrganizationRunnerGroups.

func (*ActionsService) ListOrganizationRunners

func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string, opts *ListRunnersOptions) (*Runners, *Response, error)

ListOrganizationRunners lists all the self-hosted runners for an organization.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization

func (*ActionsService) ListOrganizationRunnersIter

func (s *ActionsService) ListOrganizationRunnersIter(ctx context.Context, org string, opts *ListRunnersOptions) iter.Seq2[*Runner, error]

ListOrganizationRunnersIter returns an iterator that paginates through all results of ListOrganizationRunners.

func (*ActionsService) ListRepoOrgSecrets

func (s *ActionsService) ListRepoOrgSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error)

ListRepoOrgSecrets lists all organization secrets available in a repository without revealing their encrypted values.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-repository-organization-secrets

func (*ActionsService) ListRepoOrgSecretsIter

func (s *ActionsService) ListRepoOrgSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error]

ListRepoOrgSecretsIter returns an iterator that paginates through all results of ListRepoOrgSecrets.

func (*ActionsService) ListRepoOrgVariables

func (s *ActionsService) ListRepoOrgVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error)

ListRepoOrgVariables lists all organization variables available in a repository.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-repository-organization-variables

func (*ActionsService) ListRepoOrgVariablesIter

func (s *ActionsService) ListRepoOrgVariablesIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*ActionsVariable, error]

ListRepoOrgVariablesIter returns an iterator that paginates through all results of ListRepoOrgVariables.

func (*ActionsService) ListRepoSecrets

func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error)

ListRepoSecrets lists all secrets available in a repository without revealing their encrypted values.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-repository-secrets

func (*ActionsService) ListRepoSecretsIter

func (s *ActionsService) ListRepoSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error]

ListRepoSecretsIter returns an iterator that paginates through all results of ListRepoSecrets.

func (*ActionsService) ListRepoVariables

func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error)

ListRepoVariables lists all variables available in a repository.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-repository-variables

func (*ActionsService) ListRepoVariablesIter

func (s *ActionsService) ListRepoVariablesIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*ActionsVariable, error]

ListRepoVariablesIter returns an iterator that paginates through all results of ListRepoVariables.

func (*ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization

func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, opts *ListOptions) (*SelfHostedRunnersAllowedRepos, *Response, error)

ListRepositoriesSelfHostedRunnersAllowedInOrganization lists the repositories that are allowed to use self-hosted runners in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#list-repositories-allowed-to-use-self-hosted-runners-in-an-organization

func (*ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter

func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Repository, error]

ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter returns an iterator that paginates through all results of ListRepositoriesSelfHostedRunnersAllowedInOrganization.

func (*ActionsService) ListRepositoryAccessRunnerGroup

func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error)

ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-repository-access-to-a-self-hosted-runner-group-in-an-organization

func (*ActionsService) ListRepositoryAccessRunnerGroupIter

func (s *ActionsService) ListRepositoryAccessRunnerGroupIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*Repository, error]

ListRepositoryAccessRunnerGroupIter returns an iterator that paginates through all results of ListRepositoryAccessRunnerGroup.

func (*ActionsService) ListRepositoryWorkflowRuns

func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error)

ListRepositoryWorkflowRuns lists all workflow runs for a repository.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository

func (*ActionsService) ListRepositoryWorkflowRunsIter

func (s *ActionsService) ListRepositoryWorkflowRunsIter(ctx context.Context, owner string, repo string, opts *ListWorkflowRunsOptions) iter.Seq2[*WorkflowRun, error]

ListRepositoryWorkflowRunsIter returns an iterator that paginates through all results of ListRepositoryWorkflowRuns.

func (*ActionsService) ListRunnerApplicationDownloads

func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error)

ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository

func (*ActionsService) ListRunnerGroupHostedRunners

func (s *ActionsService) ListRunnerGroupHostedRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*HostedRunners, *Response, error)

ListRunnerGroupHostedRunners lists the GitHub-hosted runners in an organization runner group.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-github-hosted-runners-in-a-group-for-an-organization

func (*ActionsService) ListRunnerGroupHostedRunnersIter

func (s *ActionsService) ListRunnerGroupHostedRunnersIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*HostedRunner, error]

ListRunnerGroupHostedRunnersIter returns an iterator that paginates through all results of ListRunnerGroupHostedRunners.

func (*ActionsService) ListRunnerGroupRunners

func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error)

ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runners-in-a-group-for-an-organization

func (*ActionsService) ListRunnerGroupRunnersIter

func (s *ActionsService) ListRunnerGroupRunnersIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*Runner, error]

ListRunnerGroupRunnersIter returns an iterator that paginates through all results of ListRunnerGroupRunners.

func (*ActionsService) ListRunners

func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListRunnersOptions) (*Runners, *Response, error)

ListRunners lists all the self-hosted runners for a repository.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository

func (*ActionsService) ListRunnersIter

func (s *ActionsService) ListRunnersIter(ctx context.Context, owner string, repo string, opts *ListRunnersOptions) iter.Seq2[*Runner, error]

ListRunnersIter returns an iterator that paginates through all results of ListRunners.

func (*ActionsService) ListSelectedReposForOrgSecret

func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error)

ListSelectedReposForOrgSecret lists all repositories that have access to a secret.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret

func (*ActionsService) ListSelectedReposForOrgSecretIter

func (s *ActionsService) ListSelectedReposForOrgSecretIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error]

ListSelectedReposForOrgSecretIter returns an iterator that paginates through all results of ListSelectedReposForOrgSecret.

func (*ActionsService) ListSelectedReposForOrgVariable

func (s *ActionsService) ListSelectedReposForOrgVariable(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error)

ListSelectedReposForOrgVariable lists all repositories that have access to a variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-variable

func (*ActionsService) ListSelectedReposForOrgVariableIter

func (s *ActionsService) ListSelectedReposForOrgVariableIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error]

ListSelectedReposForOrgVariableIter returns an iterator that paginates through all results of ListSelectedReposForOrgVariable.

func (*ActionsService) ListWorkflowJobs

func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error)

ListWorkflowJobs lists all jobs for a workflow run.

GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run

func (*ActionsService) ListWorkflowJobsAttempt

func (s *ActionsService) ListWorkflowJobsAttempt(ctx context.Context, owner, repo string, runID, attemptNumber int64, opts *ListOptions) (*Jobs, *Response, error)

ListWorkflowJobsAttempt lists jobs for a workflow run Attempt.

GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run-attempt

func (*ActionsService) ListWorkflowJobsAttemptIter

func (s *ActionsService) ListWorkflowJobsAttemptIter(ctx context.Context, owner string, repo string, runID int64, attemptNumber int64, opts *ListOptions) iter.Seq2[*WorkflowJob, error]

ListWorkflowJobsAttemptIter returns an iterator that paginates through all results of ListWorkflowJobsAttempt.

func (*ActionsService) ListWorkflowJobsIter

func (s *ActionsService) ListWorkflowJobsIter(ctx context.Context, owner string, repo string, runID int64, opts *ListWorkflowJobsOptions) iter.Seq2[*WorkflowJob, error]

ListWorkflowJobsIter returns an iterator that paginates through all results of ListWorkflowJobs.

func (*ActionsService) ListWorkflowRunArtifacts

func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error)

ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run.

GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts

func (*ActionsService) ListWorkflowRunArtifactsIter

func (s *ActionsService) ListWorkflowRunArtifactsIter(ctx context.Context, owner string, repo string, runID int64, opts *ListOptions) iter.Seq2[*Artifact, error]

ListWorkflowRunArtifactsIter returns an iterator that paginates through all results of ListWorkflowRunArtifacts.

func (*ActionsService) ListWorkflowRunsByFileName

func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error)

ListWorkflowRunsByFileName lists all workflow runs by workflow file name.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow

func (*ActionsService) ListWorkflowRunsByFileNameIter

func (s *ActionsService) ListWorkflowRunsByFileNameIter(ctx context.Context, owner string, repo string, workflowFileName string, opts *ListWorkflowRunsOptions) iter.Seq2[*WorkflowRun, error]

ListWorkflowRunsByFileNameIter returns an iterator that paginates through all results of ListWorkflowRunsByFileName.

func (*ActionsService) ListWorkflowRunsByID

func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error)

ListWorkflowRunsByID lists all workflow runs by workflow ID.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow

func (*ActionsService) ListWorkflowRunsByIDIter

func (s *ActionsService) ListWorkflowRunsByIDIter(ctx context.Context, owner string, repo string, workflowID int64, opts *ListWorkflowRunsOptions) iter.Seq2[*WorkflowRun, error]

ListWorkflowRunsByIDIter returns an iterator that paginates through all results of ListWorkflowRunsByID.

func (*ActionsService) ListWorkflows

func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*Workflows, *Response, error)

ListWorkflows lists all workflows in a repository.

GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#list-repository-workflows

func (*ActionsService) ListWorkflowsIter

func (s *ActionsService) ListWorkflowsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Workflow, error]

ListWorkflowsIter returns an iterator that paginates through all results of ListWorkflows.

func (*ActionsService) PendingDeployments

func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo string, runID int64, request *PendingDeploymentsRequest) ([]*Deployment, *Response, error)

PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#review-pending-deployments-for-a-workflow-run

func (*ActionsService) RemoveEnabledOrgInEnterprise

func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error)

RemoveEnabledOrgInEnterprise removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#disable-a-selected-organization-for-github-actions-in-an-enterprise

func (*ActionsService) RemoveEnabledReposInOrg

func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error)

RemoveEnabledReposInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#disable-a-selected-repository-for-github-actions-in-an-organization

func (*ActionsService) RemoveOrganizationRunner

func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Response, error)

RemoveOrganizationRunner forces the removal of a self-hosted runner from an organization using the runner id.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization

func (*ActionsService) RemoveRepositoryAccessRunnerGroup

func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error)

RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have visibility set to 'selected'.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization

func (*ActionsService) RemoveRepositorySelfHostedRunnersAllowedInOrganization

func (s *ActionsService) RemoveRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryID int64) (*Response, error)

RemoveRepositorySelfHostedRunnersAllowedInOrganization removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#remove-a-repository-from-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization

func (*ActionsService) RemoveRunner

func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error)

RemoveRunner forces the removal of a self-hosted runner in a repository using the runner id.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository

func (*ActionsService) RemoveRunnerGroupRunners

func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error)

RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-a-self-hosted-runner-from-a-group-for-an-organization

func (*ActionsService) RemoveSelectedRepoFromOrgSecret

func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error)

RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret

func (*ActionsService) RemoveSelectedRepoFromOrgVariable

func (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error)

RemoveSelectedRepoFromOrgVariable removes a repository from an organization variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-variable

func (*ActionsService) RerunFailedJobsByID

func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*Response, error)

RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-failed-jobs-from-a-workflow-run

func (*ActionsService) RerunJobByID

func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, jobID int64) (*Response, error)

RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID.

You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-job-from-a-workflow-run

func (*ActionsService) RerunWorkflowByID

func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error)

RerunWorkflowByID re-runs a workflow by ID. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID of a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-workflow

func (*ActionsService) ReviewCustomDeploymentProtectionRule

func (s *ActionsService) ReviewCustomDeploymentProtectionRule(ctx context.Context, owner, repo string, runID int64, request *ReviewCustomDeploymentProtectionRuleRequest) (*Response, error)

ReviewCustomDeploymentProtectionRule approves or rejects custom deployment protection rules provided by a GitHub App for a workflow run. You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.

GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#review-custom-deployment-protection-rules-for-a-workflow-run

func (*ActionsService) SetEnabledOrgsInEnterprise

func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner string, organizationIDs []int64) (*Response, error)

SetEnabledOrgsInEnterprise replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-selected-organizations-enabled-for-github-actions-in-an-enterprise

func (*ActionsService) SetEnabledReposInOrg

func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error)

SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization..

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-selected-repositories-enabled-for-github-actions-in-an-organization

func (*ActionsService) SetOrgOIDCSubjectClaimCustomTemplate

func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error)

SetOrgOIDCSubjectClaimCustomTemplate sets the subject claim customization for an organization.

GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization

func (*ActionsService) SetRepoOIDCSubjectClaimCustomTemplate

func (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string, template *OIDCSubjectClaimCustomTemplate) (*Response, error)

SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization for a repository.

GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository

func (*ActionsService) SetRepositoriesSelfHostedRunnersAllowedInOrganization

func (s *ActionsService) SetRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryIDs []int64) (*Response, error)

SetRepositoriesSelfHostedRunnersAllowedInOrganization allows the list of repositories to use self-hosted runners in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-repositories-allowed-to-use-self-hosted-runners-in-an-organization

func (*ActionsService) SetRepositoryAccessRunnerGroup

func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error)

SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization with a new List of repositories.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-repository-access-for-a-self-hosted-runner-group-in-an-organization

func (*ActionsService) SetRunnerGroupRunners

func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error)

SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group with a new list of runners.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-self-hosted-runners-in-a-group-for-an-organization

func (*ActionsService) SetSelectedReposForOrgSecret

func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error)

SetSelectedReposForOrgSecret sets the repositories that have access to a secret.

GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-secret

func (*ActionsService) SetSelectedReposForOrgVariable

func (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error)

SetSelectedReposForOrgVariable sets the repositories that have access to a variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-variable

func (*ActionsService) UpdateActionsAllowed

func (s *ActionsService) UpdateActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error)

UpdateActionsAllowed sets the actions that are allowed in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-allowed-actions-and-reusable-workflows-for-an-organization

func (*ActionsService) UpdateActionsAllowedInEnterprise

func (s *ActionsService) UpdateActionsAllowedInEnterprise(ctx context.Context, enterprise string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error)

UpdateActionsAllowedInEnterprise sets the actions that are allowed in an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-allowed-actions-and-reusable-workflows-for-an-enterprise

func (*ActionsService) UpdateActionsPermissions

func (s *ActionsService) UpdateActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error)

UpdateActionsPermissions sets the permissions policy for repositories and allowed actions in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-github-actions-permissions-for-an-organization

func (*ActionsService) UpdateActionsPermissionsInEnterprise

func (s *ActionsService) UpdateActionsPermissionsInEnterprise(ctx context.Context, enterprise string, actionsPermissionsEnterprise ActionsPermissionsEnterprise) (*ActionsPermissionsEnterprise, *Response, error)

UpdateActionsPermissionsInEnterprise sets the permissions policy in an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-github-actions-permissions-for-an-enterprise

func (*ActionsService) UpdateArtifactAndLogRetentionPeriodInEnterprise

func (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string, period ArtifactPeriodOpt) (*Response, error)

UpdateArtifactAndLogRetentionPeriodInEnterprise sets the artifact and log retention period for an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-artifact-and-log-retention-settings-for-an-enterprise

func (*ActionsService) UpdateArtifactAndLogRetentionPeriodInOrganization

func (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string, period ArtifactPeriodOpt) (*Response, error)

UpdateArtifactAndLogRetentionPeriodInOrganization sets the artifact and log retention period for an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-artifact-and-log-retention-settings-for-an-organization

func (*ActionsService) UpdateDefaultWorkflowPermissionsInEnterprise

func (s *ActionsService) UpdateDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string, permissions DefaultWorkflowPermissionEnterprise) (*DefaultWorkflowPermissionEnterprise, *Response, error)

UpdateDefaultWorkflowPermissionsInEnterprise sets the GitHub Actions default workflow permissions for an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-default-workflow-permissions-for-an-enterprise

func (*ActionsService) UpdateDefaultWorkflowPermissionsInOrganization

func (s *ActionsService) UpdateDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string, permissions DefaultWorkflowPermissionOrganization) (*DefaultWorkflowPermissionOrganization, *Response, error)

UpdateDefaultWorkflowPermissionsInOrganization sets the GitHub Actions default workflow permissions for an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-default-workflow-permissions-for-an-organization

func (*ActionsService) UpdateEnterpriseForkPRContributorApprovalPermissions

func (s *ActionsService) UpdateEnterpriseForkPRContributorApprovalPermissions(ctx context.Context, enterprise string, policy ContributorApprovalPermissions) (*Response, error)

UpdateEnterpriseForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-fork-pr-contributor-approval-permissions-for-an-enterprise

func (*ActionsService) UpdateEnvVariable

func (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error)

UpdateEnvVariable updates an environment variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-an-environment-variable

func (*ActionsService) UpdateForkPRContributorApprovalPermissions

func (s *ActionsService) UpdateForkPRContributorApprovalPermissions(ctx context.Context, owner, repo string, policy ContributorApprovalPermissions) (*Response, error)

UpdateForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for a repository.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-fork-pr-contributor-approval-permissions-for-a-repository

func (*ActionsService) UpdateHostedRunner

func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, runnerID int64, request UpdateHostedRunnerRequest) (*HostedRunner, *Response, error)

UpdateHostedRunner updates a GitHub-hosted runner for an organization.

GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#update-a-github-hosted-runner-for-an-organization

func (*ActionsService) UpdateOrgVariable

func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error)

UpdateOrgVariable updates an organization variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-an-organization-variable

func (*ActionsService) UpdateOrganizationForkPRContributorApprovalPermissions

func (s *ActionsService) UpdateOrganizationForkPRContributorApprovalPermissions(ctx context.Context, org string, policy ContributorApprovalPermissions) (*Response, error)

UpdateOrganizationForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-fork-pr-contributor-approval-permissions-for-an-organization

func (*ActionsService) UpdateOrganizationRunnerGroup

func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error)

UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization.

GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#update-a-self-hosted-runner-group-for-an-organization

func (*ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise

func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string, permissions *WorkflowsPermissionsOpt) (*Response, error)

UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise sets the settings for whether workflows from fork pull requests can run on private repositories in an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-an-enterprise

func (*ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInOrganization

func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string, permissions *WorkflowsPermissionsOpt) (*Response, error)

UpdatePrivateRepoForkPRWorkflowSettingsInOrganization sets the settings for whether workflows from fork pull requests can run on private repositories in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-an-organization

func (*ActionsService) UpdateRepoVariable

func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error)

UpdateRepoVariable updates a repository variable.

GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-a-repository-variable

func (*ActionsService) UpdateSelfHostedRunnerPermissionsInEnterprise

func (s *ActionsService) UpdateSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string, permissions SelfHostRunnerPermissionsEnterprise) (*Response, error)

UpdateSelfHostedRunnerPermissionsInEnterprise sets the self-hosted runner permissions for an enterprise.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-self-hosted-runners-permissions-for-an-enterprise

func (*ActionsService) UpdateSelfHostedRunnersSettingsInOrganization

func (s *ActionsService) UpdateSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string, opt SelfHostedRunnersSettingsOrganizationOpt) (*Response, error)

UpdateSelfHostedRunnersSettingsInOrganization sets the self-hosted runners permissions settings for repositories in an organization.

GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-self-hosted-runners-settings-for-an-organization

type ActionsVariable

type ActionsVariable struct {
	Name       string     `json:"name"`
	Value      string     `json:"value"`
	CreatedAt  *Timestamp `json:"created_at,omitempty"`
	UpdatedAt  *Timestamp `json:"updated_at,omitempty"`
	Visibility *string    `json:"visibility,omitempty"`
	// Used by ListOrgVariables and GetOrgVariables
	SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"`
	// Used by UpdateOrgVariable and CreateOrgVariable
	SelectedRepositoryIDs *SelectedRepoIDs `json:"selected_repository_ids,omitempty"`
}

ActionsVariable represents a repository action variable.

func (*ActionsVariable) GetCreatedAt

func (a *ActionsVariable) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*ActionsVariable) GetName

func (a *ActionsVariable) GetName() string

GetName returns the Name field.

func (*ActionsVariable) GetSelectedRepositoriesURL

func (a *ActionsVariable) GetSelectedRepositoriesURL() string

GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise.

func (*ActionsVariable) GetSelectedRepositoryIDs

func (a *ActionsVariable) GetSelectedRepositoryIDs() *SelectedRepoIDs

GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field.

func (*ActionsVariable) GetUpdatedAt

func (a *ActionsVariable) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (*ActionsVariable) GetValue

func (a *ActionsVariable) GetValue() string

GetValue returns the Value field.

func (*ActionsVariable) GetVisibility

func (a *ActionsVariable) GetVisibility() string

GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.

type ActionsVariables

type ActionsVariables struct {
	TotalCount int                `json:"total_count"`
	Variables  []*ActionsVariable `json:"variables"`
}

ActionsVariables represents one item from the ListVariables response.

func (*ActionsVariables) GetTotalCount

func (a *ActionsVariables) GetTotalCount() int

GetTotalCount returns the TotalCount field.

func (*ActionsVariables) GetVariables

func (a *ActionsVariables) GetVariables() []*ActionsVariable

GetVariables returns the Variables slice if it's non-nil, nil otherwise.

type ActiveCommitters

type ActiveCommitters struct {
	TotalAdvancedSecurityCommitters     *int                          `json:"total_advanced_security_committers,omitempty"`
	TotalCount                          *int                          `json:"total_count,omitempty"`
	MaximumAdvancedSecurityCommitters   *int                          `json:"maximum_advanced_security_committers,omitempty"`
	PurchasedAdvancedSecurityCommitters *int                          `json:"purchased_advanced_security_committers,omitempty"`
	Repositories                        []*RepositoryActiveCommitters `json:"repositories"`
}

ActiveCommitters represents the total active committers across all repositories in an Organization.

func (*ActiveCommitters) GetMaximumAdvancedSecurityCommitters

func (a *ActiveCommitters) GetMaximumAdvancedSecurityCommitters() int

GetMaximumAdvancedSecurityCommitters returns the MaximumAdvancedSecurityCommitters field if it's non-nil, zero value otherwise.

func (*ActiveCommitters) GetPurchasedAdvancedSecurityCommitters

func (a *ActiveCommitters) GetPurchasedAdvancedSecurityCommitters() int

GetPurchasedAdvancedSecurityCommitters returns the PurchasedAdvancedSecurityCommitters field if it's non-nil, zero value otherwise.

func (*ActiveCommitters) GetRepositories

func (a *ActiveCommitters) GetRepositories() []*RepositoryActiveCommitters

GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.

func (*ActiveCommitters) GetTotalAdvancedSecurityCommitters

func (a *ActiveCommitters) GetTotalAdvancedSecurityCommitters() int

GetTotalAdvancedSecurityCommitters returns the TotalAdvancedSecurityCommitters field if it's non-nil, zero value otherwise.

func (*ActiveCommitters) GetTotalCount

func (a *ActiveCommitters) GetTotalCount() int

GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.

type ActiveCommittersListOptions

type ActiveCommittersListOptions struct {
	// The security product to get GitHub Advanced Security active committers for. For standalone
	// Code Scanning or Secret Protection products, this parameter is required to specify which
	// product you want committer information for. For other plans this parameter cannot be used.
	//
	// Can be one of: "code_security", "secret_protection".
	AdvancedSecurityProduct *string `url:"advanced_security_product,omitempty"`

	ListOptions
}

ActiveCommittersListOptions specifies optional parameters to the BillingService.GetAdvancedSecurityActiveCommittersOrg method.

func (*ActiveCommittersListOptions) GetAdvancedSecurityProduct

func (a *ActiveCommittersListOptions) GetAdvancedSecurityProduct() string

GetAdvancedSecurityProduct returns the AdvancedSecurityProduct field if it's non-nil, zero value otherwise.

type ActivityListStarredOptions

type ActivityListStarredOptions struct {
	// How to sort the repository list. Possible values are: created, updated,
	// pushed, full_name. Default is "full_name".
	Sort string `url:"sort,omitempty"`

	// Direction in which to sort repositories. Possible values are: asc, desc.
	// Default is "asc" when sort is "full_name"; otherwise, default is "desc".
	Direction string `url:"direction,omitempty"`

	ListOptions
}

ActivityListStarredOptions specifies the optional parameters to the ActivityService.ListStarred method.

func (*ActivityListStarredOptions) GetDirection

func (a *ActivityListStarredOptions) GetDirection() string

GetDirection returns the Direction field.

func (*ActivityListStarredOptions) GetSort

func (a *ActivityListStarredOptions) GetSort() string

GetSort returns the Sort field.

type ActivityService

type ActivityService service

ActivityService handles communication with the activity related methods of the GitHub API.

GitHub API docs: https://docs.github.com/rest/activity?apiVersion=2022-11-28

func (*ActivityService) DeleteRepositorySubscription

func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error)

DeleteRepositorySubscription deletes the subscription for the specified repository for the authenticated user.

This is used to stop watching a repository. To control whether or not to receive notifications from a repository, use SetRepositorySubscription.

GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#delete-a-repository-subscription

func (*ActivityService) DeleteThreadSubscription

func (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error)

DeleteThreadSubscription deletes the subscription for the specified thread for the authenticated user.

GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#delete-a-thread-subscription

func (*ActivityService) GetRepositorySubscription

func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *Response, error)

GetRepositorySubscription returns the subscription for the specified repository for the authenticated user. If the authenticated user is not watching the repository, a nil Subscription is returned.

GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#get-a-repository-subscription

func (*ActivityService) GetThread

func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error)

GetThread gets the specified notification thread.

GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#get-a-thread

func (*ActivityService) GetThreadSubscription

func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error)

GetThreadSubscription checks to see if the authenticated user is subscribed to a thread.

GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#get-a-thread-subscription-for-the-authenticated-user

func (*ActivityService) IsStarred

func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error)

IsStarred checks if a repository is starred by authenticated user.

GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#check-if-a-repository-is-starred-by-the-authenticated-user

func (*ActivityService) ListEvents

func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error)

ListEvents drinks from the firehose of all public events across GitHub.

GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events

func (*ActivityService) ListEventsForOrganization

func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error)

ListEventsForOrganization lists public events for an organization.

GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-organization-events

func (*ActivityService) ListEventsForOrganizationIter

func (s *ActivityService) ListEventsForOrganizationIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Event, error]

ListEventsForOrganizationIter returns an iterator that paginates through all results of ListEventsForOrganization.

func (*ActivityService) ListEventsForRepoNetwork

func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error)

ListEventsForRepoNetwork lists public events for a network of repositories.

GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events-for-a-network-of-repositories

func (*ActivityService) ListEventsForRepoNetworkIter

func (s *ActivityService) ListEventsForRepoNetworkIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Event, error]

ListEventsForRepoNetworkIter returns an iterator that paginates through all results of ListEventsForRepoNetwork.

func (*ActivityService) ListEventsIter

func (s *ActivityService) ListEventsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Event, error]

ListEventsIter returns an iterator that paginates through all results of ListEvents.

func (*ActivityService) ListEventsPerformedByUser

func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error)

ListEventsPerformedByUser lists the events performed by a user. If publicOnly is true, only public events will be returned.

GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-events-for-the-authenticated-user

GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events-for-a-user

func (*ActivityService) ListEventsPerformedByUserIter

func (s *ActivityService) ListEventsPerformedByUserIter(ctx context.Context, user string, publicOnly bool, opts *ListOptions) iter.Seq2[*Event, error]

ListEventsPerformedByUserIter returns an iterator that paginates through all results of ListEventsPerformedByUser.

func (*ActivityService) ListEventsReceivedByUser

func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error)

ListEventsReceivedByUser lists the events received by a user. If publicOnly is true, only public events will be returned.

GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-events-received-by-the-authenticated-user

GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events-received-by-a-user

func (*ActivityService) ListEventsReceivedByUserIter

func (s *ActivityService) ListEventsReceivedByUserIter(ctx context.Context, user string, publicOnly bool, opts *ListOptions) iter.Seq2[*Event, error]

ListEventsReceivedByUserIter returns an iterator that paginates through all results of ListEventsReceivedByUser.

func (*ActivityService) ListFeeds

func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error)

ListFeeds lists all the feeds available to the authenticated user.

GitHub provides several timeline resources in Atom format:

Timeline: The GitHub global public timeline
User: The public timeline for any user, using URI template
Current user public: The public timeline for the authenticated user
Current user: The private timeline for the authenticated user
Current user actor: The private timeline for activity created by the
    authenticated user
Current user organizations: The private timeline for the organizations
    the authenticated user is a member of.

Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.

GitHub API docs: https://docs.github.com/rest/activity/feeds?apiVersion=2022-11-28#get-feeds

func (*ActivityService) ListIssueEventsForRepository

func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error)

ListIssueEventsForRepository lists issue events for a repository.

GitHub API docs: https://docs.github.com/rest/issues/events?apiVersion=2022-11-28#list-issue-events-for-a-repository

func (*ActivityService) ListIssueEventsForRepositoryIter

func (s *ActivityService) ListIssueEventsForRepositoryIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*IssueEvent, error]

ListIssueEventsForRepositoryIter returns an iterator that paginates through all results of ListIssueEventsForRepository.

func (*ActivityService) ListNotifications

func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error)

ListNotifications lists all notifications for the authenticated user.

GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#list-notifications-for-the-authenticated-user

func (*ActivityService) ListNotificationsIter

func (s *ActivityService) ListNotificationsIter(ctx context.Context, opts *NotificationListOptions) iter.Seq2[*Notification, error]

ListNotificationsIter returns an iterator that paginates through all results of ListNotifications.

func (*ActivityService) ListRepositoryEvents

func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error)

ListRepositoryEvents lists events for a repository.

GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-repository-events

func (*ActivityService) ListRepositoryEventsIter

func (s *ActivityService) ListRepositoryEventsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Event, error]

ListRepositoryEventsIter returns an iterator that paginates through all results of ListRepositoryEvents.

func (*ActivityService) ListRepositoryNotifications

func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error)

ListRepositoryNotifications lists all notifications in a given repository for the authenticated user.

GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#list-repository-notifications-for-the-authenticated-user

func (*ActivityService) ListRepositoryNotificationsIter

func (s *ActivityService) ListRepositoryNotificationsIter(ctx context.Context, owner string, repo string, opts *NotificationListOptions) iter.Seq2[*Notification, error]

ListRepositoryNotificationsIter returns an iterator that paginates through all results of ListRepositoryNotifications.

func (*ActivityService) ListStargazers

func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error)

ListStargazers lists people who have starred the specified repo.

GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#list-stargazers

func (*ActivityService) ListStargazersIter

func (s *ActivityService) ListStargazersIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Stargazer, error]

ListStargazersIter returns an iterator that paginates through all results of ListStargazers.

func (*ActivityService) ListStarred

ListStarred lists all the repos starred by a user. Passing the empty string will list the starred repositories for the authenticated user.

GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#list-repositories-starred-by-a-user

GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#list-repositories-starred-by-the-authenticated-user

func (*ActivityService) ListStarredIter

ListStarredIter returns an iterator that paginates through all results of ListStarred.

func (*ActivityService) ListUserEventsForOrganization

func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error)

ListUserEventsForOrganization provides the user’s organization dashboard. You must be authenticated as the user to view this.

GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-organization-events-for-the-authenticated-user

func (*ActivityService) ListUserEventsForOrganizationIter

func (s *ActivityService) ListUserEventsForOrganizationIter(ctx context.Context, org string, user string, opts *ListOptions) iter.Seq2[*Event, error]

ListUserEventsForOrganizationIter returns an iterator that paginates through all results of ListUserEventsForOrganization.

func (*ActivityService) ListWatched

func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *ListOptions) ([]*Repository, *Response, error)

ListWatched lists the repositories the specified user is watching. Passing the empty string will fetch watched repos for the authenticated user.

GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#list-repositories-watched-by-a-user

GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#list-repositories-watched-by-the-authenticated-user

func (*ActivityService) ListWatchedIter

func (s *ActivityService) ListWatchedIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*Repository, error]

ListWatchedIter returns an iterator that paginates through all results of ListWatched.

func (*ActivityService) ListWatchers

func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error)

ListWatchers lists watchers of a particular repo.

GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#list-watchers

func (*ActivityService) ListWatchersIter

func (s *ActivityService) ListWatchersIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*User, error]

ListWatchersIter returns an iterator that paginates through all results of ListWatchers.

func (*ActivityService) MarkNotificationsRead

func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Timestamp) (*Response, error)

MarkNotificationsRead marks all notifications up to lastRead as read. If lastRead is the zero value, all notifications in the repository are marked as read.

GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-notifications-as-read

func (*ActivityService) MarkRepositoryNotificationsRead

func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead Timestamp) (*Response, error)

MarkRepositoryNotificationsRead marks all notifications up to lastRead in the specified repository as read. If lastRead is the zero value, all notifications in the repository are marked as read.

GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-repository-notifications-as-read

func (*ActivityService) MarkThreadDone

func (s *ActivityService) MarkThreadDone(ctx context.Context, id string) (*Response, error)

MarkThreadDone marks the specified thread as done. Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done.

GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-done

func (*ActivityService) MarkThreadRead

func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error)

MarkThreadRead marks the specified thread as read.

GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-read

func (*ActivityService) SetRepositorySubscription

func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error)

SetRepositorySubscription sets the subscription for the specified repository for the authenticated user.

To watch a repository, set subscription.Subscribed to true. To ignore notifications made within a repository, set subscription.Ignored to true. To stop watching a repository, use DeleteRepositorySubscription.

GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#set-a-repository-subscription

func (*ActivityService) SetThreadSubscription

func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error)

SetThreadSubscription sets the subscription for the specified thread for the authenticated user.

GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#set-a-thread-subscription

func (*ActivityService) Star

func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error)

Star a repository as the authenticated user.

GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#star-a-repository-for-the-authenticated-user

func (*ActivityService) Unstar

func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error)

Unstar a repository as the authenticated user.

GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#unstar-a-repository-for-the-authenticated-user

type ActorLocation

type ActorLocation struct {
	CountryCode *string `json:"country_code,omitempty"`
}

ActorLocation contains information about reported location for an actor.

func (*ActorLocation) GetCountryCode

func (a *ActorLocation) GetCountryCode() string

GetCountryCode returns the CountryCode field if it's non-nil, zero value otherwise.

type AddProjectItemOptions

type AddProjectItemOptions struct {
	Type *ProjectV2ItemContentType `json:"type,omitempty"`
	ID   *int64                    `json:"id,omitempty"`
}

AddProjectItemOptions represents the payload to add an item (issue or pull request) to a project. The Type must be either "Issue" or "PullRequest" (as per API docs) and ID is the numerical ID of that issue or pull request.

func (*AddProjectItemOptions) GetID

func (a *AddProjectItemOptions) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*AddProjectItemOptions) GetType

GetType returns the Type field.

type AddResourcesToCostCenterResponse

type AddResourcesToCostCenterResponse struct {
	Message             *string               `json:"message,omitempty"`
	ReassignedResources []*ReassignedResource `json:"reassigned_resources,omitempty"`
}

AddResourcesToCostCenterResponse represents a response from adding resources to a cost center.

func (*AddResourcesToCostCenterResponse) GetMessage

func (a *AddResourcesToCostCenterResponse) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*AddResourcesToCostCenterResponse) GetReassignedResources

func (a *AddResourcesToCostCenterResponse) GetReassignedResources() []*ReassignedResource

GetReassignedResources returns the ReassignedResources slice if it's non-nil, nil otherwise.

type AdminEnforcedChanges

type AdminEnforcedChanges struct {
	From *bool `json:"from,omitempty"`
}

AdminEnforcedChanges represents the changes made to the AdminEnforced policy.

func (*AdminEnforcedChanges) GetFrom

func (a *AdminEnforcedChanges) GetFrom() bool

GetFrom returns the From field if it's non-nil, zero value otherwise.

type AdminEnforcement

type AdminEnforcement struct {
	URL     *string `json:"url,omitempty"`
	Enabled bool    `json:"enabled"`
}

AdminEnforcement represents the configuration to enforce required status checks for repository administrators.

func (*AdminEnforcement) GetEnabled

func (a *AdminEnforcement) GetEnabled() bool

GetEnabled returns the Enabled field.

func (*AdminEnforcement) GetURL

func (a *AdminEnforcement) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type AdminService

type AdminService service

AdminService handles communication with the admin related methods of the GitHub API. These API routes are normally only accessible for GitHub Enterprise installations.

GitHub API docs: https://docs.github.com/rest/enterprise-admin?apiVersion=2022-11-28

func (*AdminService) CreateOrg

func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error)

CreateOrg creates a new organization in GitHub Enterprise.

Note that only a subset of the org fields are used and org must not be nil.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/orgs#create-an-organization

func (*AdminService) CreateUser

func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error)

CreateUser creates a new user in GitHub Enterprise.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#create-a-user

func (*AdminService) CreateUserImpersonation

func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error)

CreateUserImpersonation creates an impersonation OAuth token.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#create-an-impersonation-oauth-token

func (*AdminService) DeleteUser

func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error)

DeleteUser deletes a user in GitHub Enterprise.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#delete-a-user

func (*AdminService) DeleteUserImpersonation

func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error)

DeleteUserImpersonation deletes an impersonation OAuth token.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#delete-an-impersonation-oauth-token

func (*AdminService) GetAdminStats

func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error)

GetAdminStats returns a variety of metrics about a GitHub Enterprise installation.

Please note that this is only available to site administrators, otherwise it will error with a 404 not found (instead of 401 or 403).

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/admin-stats#get-all-statistics

func (*AdminService) RenameOrg

func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error)

RenameOrg renames an organization in GitHub Enterprise.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/orgs#update-an-organization-name

func (*AdminService) RenameOrgByName

func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error)

RenameOrgByName renames an organization in GitHub Enterprise using its current name.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/orgs#update-an-organization-name

func (*AdminService) UpdateTeamLDAPMapping

func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error)

UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team

func (*AdminService) UpdateUserLDAPMapping

func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error)

UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user

type AdminStats

type AdminStats struct {
	Issues     *IssueStats     `json:"issues,omitempty"`
	Hooks      *HookStats      `json:"hooks,omitempty"`
	Milestones *MilestoneStats `json:"milestones,omitempty"`
	Orgs       *OrgStats       `json:"orgs,omitempty"`
	Comments   *CommentStats   `json:"comments,omitempty"`
	Pages      *PageStats      `json:"pages,omitempty"`
	Users      *UserStats      `json:"users,omitempty"`
	Gists      *GistStats      `json:"gists,omitempty"`
	Pulls      *PullStats      `json:"pulls,omitempty"`
	Repos      *RepoStats      `json:"repos,omitempty"`
}

AdminStats represents a variety of stats of a GitHub Enterprise installation.

func (*AdminStats) GetComments

func (a *AdminStats) GetComments() *CommentStats

GetComments returns the Comments field.

func (*AdminStats) GetGists

func (a *AdminStats) GetGists() *GistStats

GetGists returns the Gists field.

func (*AdminStats) GetHooks

func (a *AdminStats) GetHooks() *HookStats

GetHooks returns the Hooks field.

func (*AdminStats) GetIssues

func (a *AdminStats) GetIssues() *IssueStats

GetIssues returns the Issues field.

func (*AdminStats) GetMilestones

func (a *AdminStats) GetMilestones() *MilestoneStats

GetMilestones returns the Milestones field.

func (*AdminStats) GetOrgs

func (a *AdminStats) GetOrgs() *OrgStats

GetOrgs returns the Orgs field.

func (*AdminStats) GetPages

func (a *AdminStats) GetPages() *PageStats

GetPages returns the Pages field.

func (*AdminStats) GetPulls

func (a *AdminStats) GetPulls() *PullStats

GetPulls returns the Pulls field.

func (*AdminStats) GetRepos

func (a *AdminStats) GetRepos() *RepoStats

GetRepos returns the Repos field.

func (*AdminStats) GetUsers

func (a *AdminStats) GetUsers() *UserStats

GetUsers returns the Users field.

func (AdminStats) String

func (s AdminStats) String() string

type AdvancedSecurity

type AdvancedSecurity struct {
	Status *string `json:"status,omitempty"`
}

AdvancedSecurity specifies the state of advanced security on a repository.

GitHub API docs: https://docs.github.com/github/getting-started-with-github/learning-about-github/about-github-advanced-security

func (*AdvancedSecurity) GetStatus

func (a *AdvancedSecurity) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (AdvancedSecurity) String

func (a AdvancedSecurity) String() string

type AdvancedSecurityCommittersBreakdown

type AdvancedSecurityCommittersBreakdown struct {
	UserLogin       string `json:"user_login"`
	LastPushedDate  string `json:"last_pushed_date"`
	LastPushedEmail string `json:"last_pushed_email"`
}

AdvancedSecurityCommittersBreakdown represents the user activity breakdown for ActiveCommitters.

func (*AdvancedSecurityCommittersBreakdown) GetLastPushedDate

func (a *AdvancedSecurityCommittersBreakdown) GetLastPushedDate() string

GetLastPushedDate returns the LastPushedDate field.

func (*AdvancedSecurityCommittersBreakdown) GetLastPushedEmail

func (a *AdvancedSecurityCommittersBreakdown) GetLastPushedEmail() string

GetLastPushedEmail returns the LastPushedEmail field.

func (*AdvancedSecurityCommittersBreakdown) GetUserLogin

func (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string

GetUserLogin returns the UserLogin field.

type AdvisoryCVSS

type AdvisoryCVSS struct {
	Score        *float64 `json:"score,omitempty"`
	VectorString *string  `json:"vector_string,omitempty"`
}

AdvisoryCVSS represents the advisory pertaining to the Common Vulnerability Scoring System.

func (*AdvisoryCVSS) GetScore

func (a *AdvisoryCVSS) GetScore() float64

GetScore returns the Score field if it's non-nil, zero value otherwise.

func (*AdvisoryCVSS) GetVectorString

func (a *AdvisoryCVSS) GetVectorString() string

GetVectorString returns the VectorString field if it's non-nil, zero value otherwise.

type AdvisoryCWEs

type AdvisoryCWEs struct {
	CWEID *string `json:"cwe_id,omitempty"`
	Name  *string `json:"name,omitempty"`
}

AdvisoryCWEs represent the advisory pertaining to Common Weakness Enumeration.

func (*AdvisoryCWEs) GetCWEID

func (a *AdvisoryCWEs) GetCWEID() string

GetCWEID returns the CWEID field if it's non-nil, zero value otherwise.

func (*AdvisoryCWEs) GetName

func (a *AdvisoryCWEs) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

type AdvisoryEPSS

type AdvisoryEPSS struct {
	Percentage float64 `json:"percentage"`
	Percentile float64 `json:"percentile"`
}

AdvisoryEPSS represents the advisory pertaining to the Exploit Prediction Scoring System.

For more information, see: https://github.blog/changelog/2024-10-10-epss-scores-in-the-github-advisory-database/

func (*AdvisoryEPSS) GetPercentage

func (a *AdvisoryEPSS) GetPercentage() float64

GetPercentage returns the Percentage field.

func (*AdvisoryEPSS) GetPercentile

func (a *AdvisoryEPSS) GetPercentile() float64

GetPercentile returns the Percentile field.

type AdvisoryIdentifier

type AdvisoryIdentifier struct {
	Value *string `json:"value,omitempty"`
	Type  *string `json:"type,omitempty"`
}

AdvisoryIdentifier represents the identifier for a Security Advisory.

func (*AdvisoryIdentifier) GetType

func (a *AdvisoryIdentifier) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*AdvisoryIdentifier) GetValue

func (a *AdvisoryIdentifier) GetValue() string

GetValue returns the Value field if it's non-nil, zero value otherwise.

type AdvisoryReference

type AdvisoryReference struct {
	URL *string `json:"url,omitempty"`
}

AdvisoryReference represents the reference url for the security advisory.

func (*AdvisoryReference) GetURL

func (a *AdvisoryReference) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type AdvisoryVulnerability

type AdvisoryVulnerability struct {
	Package                *VulnerabilityPackage `json:"package,omitempty"`
	Severity               *string               `json:"severity,omitempty"`
	VulnerableVersionRange *string               `json:"vulnerable_version_range,omitempty"`
	FirstPatchedVersion    *FirstPatchedVersion  `json:"first_patched_version,omitempty"`

	// PatchedVersions and VulnerableFunctions are used in the following APIs:
	// - https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories-for-an-organization
	// - https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories
	PatchedVersions     *string  `json:"patched_versions,omitempty"`
	VulnerableFunctions []string `json:"vulnerable_functions,omitempty"`
}

AdvisoryVulnerability represents the vulnerability object for a Security Advisory.

func (*AdvisoryVulnerability) GetFirstPatchedVersion

func (a *AdvisoryVulnerability) GetFirstPatchedVersion() *FirstPatchedVersion

GetFirstPatchedVersion returns the FirstPatchedVersion field.

func (*AdvisoryVulnerability) GetPackage

GetPackage returns the Package field.

func (*AdvisoryVulnerability) GetPatchedVersions

func (a *AdvisoryVulnerability) GetPatchedVersions() string

GetPatchedVersions returns the PatchedVersions field if it's non-nil, zero value otherwise.

func (*AdvisoryVulnerability) GetSeverity

func (a *AdvisoryVulnerability) GetSeverity() string

GetSeverity returns the Severity field if it's non-nil, zero value otherwise.

func (*AdvisoryVulnerability) GetVulnerableFunctions

func (a *AdvisoryVulnerability) GetVulnerableFunctions() []string

GetVulnerableFunctions returns the VulnerableFunctions slice if it's non-nil, nil otherwise.

func (*AdvisoryVulnerability) GetVulnerableVersionRange

func (a *AdvisoryVulnerability) GetVulnerableVersionRange() string

GetVulnerableVersionRange returns the VulnerableVersionRange field if it's non-nil, zero value otherwise.

type Alert

type Alert struct {
	Number             *int                  `json:"number,omitempty"`
	Repository         *Repository           `json:"repository,omitempty"`
	RuleID             *string               `json:"rule_id,omitempty"`
	RuleSeverity       *string               `json:"rule_severity,omitempty"`
	RuleDescription    *string               `json:"rule_description,omitempty"`
	Rule               *Rule                 `json:"rule,omitempty"`
	Tool               *Tool                 `json:"tool,omitempty"`
	CreatedAt          *Timestamp            `json:"created_at,omitempty"`
	UpdatedAt          *Timestamp            `json:"updated_at,omitempty"`
	FixedAt            *Timestamp            `json:"fixed_at,omitempty"`
	State              *string               `json:"state,omitempty"`
	ClosedBy           *User                 `json:"closed_by,omitempty"`
	ClosedAt           *Timestamp            `json:"closed_at,omitempty"`
	URL                *string               `json:"url,omitempty"`
	HTMLURL            *string               `json:"html_url,omitempty"`
	MostRecentInstance *MostRecentInstance   `json:"most_recent_instance,omitempty"`
	Instances          []*MostRecentInstance `json:"instances,omitempty"`
	DismissedBy        *User                 `json:"dismissed_by,omitempty"`
	DismissedAt        *Timestamp            `json:"dismissed_at,omitempty"`
	DismissedReason    *string               `json:"dismissed_reason,omitempty"`
	DismissedComment   *string               `json:"dismissed_comment,omitempty"`
	InstancesURL       *string               `json:"instances_url,omitempty"`
}

Alert represents an individual GitHub Code Scanning Alert on a single repository.

GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28

func (*Alert) GetClosedAt

func (a *Alert) GetClosedAt() Timestamp

GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.

func (*Alert) GetClosedBy

func (a *Alert) GetClosedBy() *User

GetClosedBy returns the ClosedBy field.

func (*Alert) GetCreatedAt

func (a *Alert) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Alert) GetDismissedAt

func (a *Alert) GetDismissedAt() Timestamp

GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise.

func (*Alert) GetDismissedBy

func (a *Alert) GetDismissedBy() *User

GetDismissedBy returns the DismissedBy field.

func (*Alert) GetDismissedComment

func (a *Alert) GetDismissedComment() string

GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise.

func (*Alert) GetDismissedReason

func (a *Alert) GetDismissedReason() string

GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise.

func (*Alert) GetFixedAt

func (a *Alert) GetFixedAt() Timestamp

GetFixedAt returns the FixedAt field if it's non-nil, zero value otherwise.

func (*Alert) GetHTMLURL

func (a *Alert) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Alert) GetInstances

func (a *Alert) GetInstances() []*MostRecentInstance

GetInstances returns the Instances slice if it's non-nil, nil otherwise.

func (*Alert) GetInstancesURL

func (a *Alert) GetInstancesURL() string

GetInstancesURL returns the InstancesURL field if it's non-nil, zero value otherwise.

func (*Alert) GetMostRecentInstance

func (a *Alert) GetMostRecentInstance() *MostRecentInstance

GetMostRecentInstance returns the MostRecentInstance field.

func (*Alert) GetNumber

func (a *Alert) GetNumber() int

GetNumber returns the Number field if it's non-nil, zero value otherwise.

func (*Alert) GetRepository

func (a *Alert) GetRepository() *Repository

GetRepository returns the Repository field.

func (*Alert) GetRule

func (a *Alert) GetRule() *Rule

GetRule returns the Rule field.

func (*Alert) GetRuleDescription

func (a *Alert) GetRuleDescription() string

GetRuleDescription returns the RuleDescription field if it's non-nil, zero value otherwise.

func (*Alert) GetRuleID

func (a *Alert) GetRuleID() string

GetRuleID returns the RuleID field if it's non-nil, zero value otherwise.

func (*Alert) GetRuleSeverity

func (a *Alert) GetRuleSeverity() string

GetRuleSeverity returns the RuleSeverity field if it's non-nil, zero value otherwise.

func (*Alert) GetState

func (a *Alert) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*Alert) GetTool

func (a *Alert) GetTool() *Tool

GetTool returns the Tool field.

func (*Alert) GetURL

func (a *Alert) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Alert) GetUpdatedAt

func (a *Alert) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (*Alert) ID

func (a *Alert) ID() int64

ID returns the ID associated with an alert. It is the number at the end of the security alert's URL.

type AlertInstancesListOptions

type AlertInstancesListOptions struct {
	// Return code scanning alert instances for a specific branch reference.
	// The ref can be formatted as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge
	Ref string `url:"ref,omitempty"`

	ListOptions
}

AlertInstancesListOptions specifies optional parameters to the CodeScanningService.ListAlertInstances method.

func (*AlertInstancesListOptions) GetRef

func (a *AlertInstancesListOptions) GetRef() string

GetRef returns the Ref field.

type AlertListOptions

type AlertListOptions struct {
	// State of the code scanning alerts to list. Set to closed to list only closed code scanning alerts. Default: open
	State string `url:"state,omitempty"`

	// Return code scanning alerts for a specific branch reference.
	// The ref can be formatted as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge
	Ref string `url:"ref,omitempty"`

	// If specified, only code scanning alerts with this severity will be returned. Possible values are: critical, high, medium, low, warning, note, error.
	Severity string `url:"severity,omitempty"`

	// The name of a code scanning tool. Only results by this tool will be listed.
	ToolName string `url:"tool_name,omitempty"`

	// The GUID of a code scanning tool. Only results by this tool will be listed.
	ToolGUID string `url:"tool_guid,omitempty"`

	// The direction to sort the results by. Possible values are: asc, desc. Default: desc.
	Direction string `url:"direction,omitempty"`

	// The property by which to sort the results. Possible values are: created, updated. Default: created.
	Sort string `url:"sort,omitempty"`

	ListCursorOptions

	// Add ListOptions so offset pagination with integer type "page" query parameter is accepted
	// since ListCursorOptions accepts "page" as string only.
	ListOptions
}

AlertListOptions specifies optional parameters to the CodeScanningService.ListAlerts method.

func (*AlertListOptions) GetDirection

func (a *AlertListOptions) GetDirection() string

GetDirection returns the Direction field.

func (*AlertListOptions) GetRef

func (a *AlertListOptions) GetRef() string

GetRef returns the Ref field.

func (*AlertListOptions) GetSeverity

func (a *AlertListOptions) GetSeverity() string

GetSeverity returns the Severity field.

func (*AlertListOptions) GetSort

func (a *AlertListOptions) GetSort() string

GetSort returns the Sort field.

func (*AlertListOptions) GetState

func (a *AlertListOptions) GetState() string

GetState returns the State field.

func (*AlertListOptions) GetToolGUID

func (a *AlertListOptions) GetToolGUID() string

GetToolGUID returns the ToolGUID field.

func (*AlertListOptions) GetToolName

func (a *AlertListOptions) GetToolName() string

GetToolName returns the ToolName field.

type AllowDeletions

type AllowDeletions struct {
	Enabled bool `json:"enabled"`
}

AllowDeletions represents the configuration to accept deletion of protected branches.

func (*AllowDeletions) GetEnabled

func (a *AllowDeletions) GetEnabled() bool

GetEnabled returns the Enabled field.

type AllowDeletionsEnforcementLevelChanges

type AllowDeletionsEnforcementLevelChanges struct {
	From *string `json:"from,omitempty"`
}

AllowDeletionsEnforcementLevelChanges represents the changes made to the AllowDeletionsEnforcementLevel policy.

func (*AllowDeletionsEnforcementLevelChanges) GetFrom

GetFrom returns the From field if it's non-nil, zero value otherwise.

type AllowForcePushes

type AllowForcePushes struct {
	Enabled bool `json:"enabled"`
}

AllowForcePushes represents the configuration to accept forced pushes on protected branches.

func (*AllowForcePushes) GetEnabled

func (a *AllowForcePushes) GetEnabled() bool

GetEnabled returns the Enabled field.

type AllowForkSyncing

type AllowForkSyncing struct {
	Enabled *bool `json:"enabled,omitempty"`
}

AllowForkSyncing represents whether users can pull changes from upstream when the branch is locked.

func (*AllowForkSyncing) GetEnabled

func (a *AllowForkSyncing) GetEnabled() bool

GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.

type AmazonS3AccessKeysConfig

type AmazonS3AccessKeysConfig struct {
	Bucket               string `json:"bucket"`
	Region               string `json:"region"`
	KeyID                string `json:"key_id"`
	AuthenticationType   string `json:"authentication_type"` // Value: "access_keys"
	EncryptedSecretKey   string `json:"encrypted_secret_key"`
	EncryptedAccessKeyID string `json:"encrypted_access_key_id"`
}

AmazonS3AccessKeysConfig represents vendor-specific config for Amazon S3 with access key authentication.

func (*AmazonS3AccessKeysConfig) GetAuthenticationType

func (a *AmazonS3AccessKeysConfig) GetAuthenticationType() string

GetAuthenticationType returns the AuthenticationType field.

func (*AmazonS3AccessKeysConfig) GetBucket

func (a *AmazonS3AccessKeysConfig) GetBucket() string

GetBucket returns the Bucket field.

func (*AmazonS3AccessKeysConfig) GetEncryptedAccessKeyID

func (a *AmazonS3AccessKeysConfig) GetEncryptedAccessKeyID() string

GetEncryptedAccessKeyID returns the EncryptedAccessKeyID field.

func (*AmazonS3AccessKeysConfig) GetEncryptedSecretKey

func (a *AmazonS3AccessKeysConfig) GetEncryptedSecretKey() string

GetEncryptedSecretKey returns the EncryptedSecretKey field.

func (*AmazonS3AccessKeysConfig) GetKeyID

func (a *AmazonS3AccessKeysConfig) GetKeyID() string

GetKeyID returns the KeyID field.

func (*AmazonS3AccessKeysConfig) GetRegion

func (a *AmazonS3AccessKeysConfig) GetRegion() string

GetRegion returns the Region field.

type AmazonS3OIDCConfig

type AmazonS3OIDCConfig struct {
	Bucket             string `json:"bucket"`
	Region             string `json:"region"`
	KeyID              string `json:"key_id"`
	AuthenticationType string `json:"authentication_type"` // Value: "oidc"
	ArnRole            string `json:"arn_role"`
}

AmazonS3OIDCConfig represents vendor-specific config for Amazon S3 with OIDC authentication.

func (*AmazonS3OIDCConfig) GetArnRole

func (a *AmazonS3OIDCConfig) GetArnRole() string

GetArnRole returns the ArnRole field.

func (*AmazonS3OIDCConfig) GetAuthenticationType

func (a *AmazonS3OIDCConfig) GetAuthenticationType() string

GetAuthenticationType returns the AuthenticationType field.

func (*AmazonS3OIDCConfig) GetBucket

func (a *AmazonS3OIDCConfig) GetBucket() string

GetBucket returns the Bucket field.

func (*AmazonS3OIDCConfig) GetKeyID

func (a *AmazonS3OIDCConfig) GetKeyID() string

GetKeyID returns the KeyID field.

func (*AmazonS3OIDCConfig) GetRegion

func (a *AmazonS3OIDCConfig) GetRegion() string

GetRegion returns the Region field.

type AnalysesListOptions

type AnalysesListOptions struct {
	// Return code scanning analyses belonging to the same SARIF upload.
	SarifID *string `url:"sarif_id,omitempty"`

	// Return code scanning analyses for a specific branch reference.
	// The ref can be formatted as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge
	Ref *string `url:"ref,omitempty"`

	ListOptions
}

AnalysesListOptions specifies optional parameters to the CodeScanningService.ListAnalysesForRepo method.

func (*AnalysesListOptions) GetRef

func (a *AnalysesListOptions) GetRef() string

GetRef returns the Ref field if it's non-nil, zero value otherwise.

func (*AnalysesListOptions) GetSarifID

func (a *AnalysesListOptions) GetSarifID() string

GetSarifID returns the SarifID field if it's non-nil, zero value otherwise.

type App

type App struct {
	ID                 *int64                   `json:"id,omitempty"`
	Slug               *string                  `json:"slug,omitempty"`
	ClientID           *string                  `json:"client_id,omitempty"`
	NodeID             *string                  `json:"node_id,omitempty"`
	Owner              *User                    `json:"owner,omitempty"`
	Name               *string                  `json:"name,omitempty"`
	Description        *string                  `json:"description,omitempty"`
	ExternalURL        *string                  `json:"external_url,omitempty"`
	HTMLURL            *string                  `json:"html_url,omitempty"`
	CreatedAt          *Timestamp               `json:"created_at,omitempty"`
	UpdatedAt          *Timestamp               `json:"updated_at,omitempty"`
	Permissions        *InstallationPermissions `json:"permissions,omitempty"`
	Events             []string                 `json:"events,omitempty"`
	InstallationsCount *int                     `json:"installations_count,omitempty"`
}

App represents a GitHub App.

func (*App) GetClientID

func (a *App) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*App) GetCreatedAt

func (a *App) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*App) GetDescription

func (a *App) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*App) GetEvents

func (a *App) GetEvents() []string

GetEvents returns the Events slice if it's non-nil, nil otherwise.

func (*App) GetExternalURL

func (a *App) GetExternalURL() string

GetExternalURL returns the ExternalURL field if it's non-nil, zero value otherwise.

func (*App) GetHTMLURL

func (a *App) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*App) GetID

func (a *App) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*App) GetInstallationsCount

func (a *App) GetInstallationsCount() int

GetInstallationsCount returns the InstallationsCount field if it's non-nil, zero value otherwise.

func (*App) GetName

func (a *App) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*App) GetNodeID

func (a *App) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*App) GetOwner

func (a *App) GetOwner() *User

GetOwner returns the Owner field.

func (*App) GetPermissions

func (a *App) GetPermissions() *InstallationPermissions

GetPermissions returns the Permissions field.

func (*App) GetSlug

func (a *App) GetSlug() string

GetSlug returns the Slug field if it's non-nil, zero value otherwise.

func (*App) GetUpdatedAt

func (a *App) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type AppConfig

type AppConfig struct {
	ID            *int64     `json:"id,omitempty"`
	Slug          *string    `json:"slug,omitempty"`
	NodeID        *string    `json:"node_id,omitempty"`
	Owner         *User      `json:"owner,omitempty"`
	Name          *string    `json:"name,omitempty"`
	Description   *string    `json:"description,omitempty"`
	ExternalURL   *string    `json:"external_url,omitempty"`
	HTMLURL       *string    `json:"html_url,omitempty"`
	CreatedAt     *Timestamp `json:"created_at,omitempty"`
	UpdatedAt     *Timestamp `json:"updated_at,omitempty"`
	ClientID      *string    `json:"client_id,omitempty"`
	ClientSecret  *string    `json:"client_secret,omitempty"`
	WebhookSecret *string    `json:"webhook_secret,omitempty"`
	PEM           *string    `json:"pem,omitempty"`
}

AppConfig describes the configuration of a GitHub App.

func (*AppConfig) GetClientID

func (a *AppConfig) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*AppConfig) GetClientSecret

func (a *AppConfig) GetClientSecret() string

GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise.

func (*AppConfig) GetCreatedAt

func (a *AppConfig) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*AppConfig) GetDescription

func (a *AppConfig) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*AppConfig) GetExternalURL

func (a *AppConfig) GetExternalURL() string

GetExternalURL returns the ExternalURL field if it's non-nil, zero value otherwise.

func (*AppConfig) GetHTMLURL

func (a *AppConfig) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*AppConfig) GetID

func (a *AppConfig) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*AppConfig) GetName

func (a *AppConfig) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*AppConfig) GetNodeID

func (a *AppConfig) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*AppConfig) GetOwner

func (a *AppConfig) GetOwner() *User

GetOwner returns the Owner field.

func (*AppConfig) GetPEM

func (a *AppConfig) GetPEM() string

GetPEM returns the PEM field if it's non-nil, zero value otherwise.

func (*AppConfig) GetSlug

func (a *AppConfig) GetSlug() string

GetSlug returns the Slug field if it's non-nil, zero value otherwise.

func (*AppConfig) GetUpdatedAt

func (a *AppConfig) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (*AppConfig) GetWebhookSecret

func (a *AppConfig) GetWebhookSecret() string

GetWebhookSecret returns the WebhookSecret field if it's non-nil, zero value otherwise.

type AppInstallationRepositoriesOptions

type AppInstallationRepositoriesOptions struct {
	SelectedRepositoryIDs []int64 `json:"selected_repository_ids"`
}

AppInstallationRepositoriesOptions specifies the parameters for EnterpriseService.AddRepositoriesToAppInstallation and EnterpriseService.RemoveRepositoriesFromAppInstallation.

func (*AppInstallationRepositoriesOptions) GetSelectedRepositoryIDs

func (a *AppInstallationRepositoriesOptions) GetSelectedRepositoryIDs() []int64

GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise.

type AppsService

type AppsService service

AppsService provides access to the installation related functions in the GitHub API.

GitHub API docs: https://docs.github.com/rest/apps?apiVersion=2022-11-28

func (*AppsService) AddRepository

func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error)

AddRepository adds a single repository to an installation.

GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#add-a-repository-to-an-app-installation

func (*AppsService) CompleteAppManifest

func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error)

CompleteAppManifest completes the App manifest handshake flow for the given code.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-a-github-app-from-a-manifest

func (*AppsService) CreateAttachment

func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error)

CreateAttachment creates a new attachment on user comment containing a url.

GitHub API docs: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment

func (*AppsService) CreateInstallationToken

func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opts *InstallationTokenOptions) (*InstallationToken, *Response, error)

CreateInstallationToken creates a new installation token.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app

func (*AppsService) CreateInstallationTokenListRepos

func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id int64, opts *InstallationTokenListRepoOptions) (*InstallationToken, *Response, error)

CreateInstallationTokenListRepos creates a new installation token with a list of all repositories in an installation which is not possible with CreateInstallationToken.

It differs from CreateInstallationToken by taking InstallationTokenListRepoOptions as a parameter which does not omit RepositoryIDs if that field is nil or an empty array.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app

func (*AppsService) DeleteInstallation

func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Response, error)

DeleteInstallation deletes the specified installation.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#delete-an-installation-for-the-authenticated-app

func (*AppsService) Get

func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, error)

Get a single GitHub App. Passing the empty string will get the authenticated GitHub App.

Note: appSlug is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., https://github.com/settings/apps/:app_slug).

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-an-app

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-the-authenticated-app

func (*AppsService) GetEnterpriseInstallation

func (s *AppsService) GetEnterpriseInstallation(ctx context.Context, enterprise string) (*Installation, *Response, error)

GetEnterpriseInstallation finds the enterprise's installation information.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/apps/apps?apiVersion=2022-11-28#get-an-enterprise-installation-for-the-authenticated-app

func (*AppsService) GetHookConfig

func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error)

GetHookConfig returns the webhook configuration for a GitHub App. The underlying transport must be authenticated as an app.

GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-app

func (*AppsService) GetHookDelivery

func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error)

GetHookDelivery returns the App webhook delivery with the specified ID.

GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#get-a-delivery-for-an-app-webhook

func (*AppsService) GetInstallation

func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error)

GetInstallation returns the specified installation.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-an-installation-for-the-authenticated-app

func (*AppsService) GetOrganizationInstallation

func (s *AppsService) GetOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error)

GetOrganizationInstallation finds the organization's installation information.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-an-organization-installation-for-the-authenticated-app

func (*AppsService) GetRepositoryInstallation

func (s *AppsService) GetRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error)

GetRepositoryInstallation finds the repository's installation information.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-repository-installation-for-the-authenticated-app

func (*AppsService) GetRepositoryInstallationByID

func (s *AppsService) GetRepositoryInstallationByID(ctx context.Context, id int64) (*Installation, *Response, error)

GetRepositoryInstallationByID finds the repository's installation information.

Note: GetRepositoryInstallationByID uses the undocumented GitHub API endpoint "GET /repositories/{repository_id}/installation".

func (*AppsService) GetUserInstallation

func (s *AppsService) GetUserInstallation(ctx context.Context, user string) (*Installation, *Response, error)

GetUserInstallation finds the user's installation information.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app

func (*AppsService) ListHookDeliveries

func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOptions) ([]*HookDelivery, *Response, error)

ListHookDeliveries lists deliveries of an App webhook.

GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#list-deliveries-for-an-app-webhook

func (*AppsService) ListHookDeliveriesIter

func (s *AppsService) ListHookDeliveriesIter(ctx context.Context, opts *ListCursorOptions) iter.Seq2[*HookDelivery, error]

ListHookDeliveriesIter returns an iterator that paginates through all results of ListHookDeliveries.

func (*AppsService) ListInstallationRequests

func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOptions) ([]*InstallationRequest, *Response, error)

ListInstallationRequests lists the pending installation requests that the current GitHub App has.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#list-installation-requests-for-the-authenticated-app

func (*AppsService) ListInstallationRequestsIter

func (s *AppsService) ListInstallationRequestsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*InstallationRequest, error]

ListInstallationRequestsIter returns an iterator that paginates through all results of ListInstallationRequests.

func (*AppsService) ListInstallations

func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error)

ListInstallations lists the installations that the current GitHub App has.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#list-installations-for-the-authenticated-app

func (*AppsService) ListInstallationsIter

func (s *AppsService) ListInstallationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Installation, error]

ListInstallationsIter returns an iterator that paginates through all results of ListInstallations.

func (*AppsService) ListRepos

func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRepositories, *Response, error)

ListRepos lists the repositories that are accessible to the authenticated installation.

GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#list-repositories-accessible-to-the-app-installation

func (*AppsService) ListReposIter

func (s *AppsService) ListReposIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Repository, error]

ListReposIter returns an iterator that paginates through all results of ListRepos.

func (*AppsService) ListUserInstallations

func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error)

ListUserInstallations lists installations that are accessible to the authenticated user.

GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#list-app-installations-accessible-to-the-user-access-token

func (*AppsService) ListUserInstallationsIter

func (s *AppsService) ListUserInstallationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Installation, error]

ListUserInstallationsIter returns an iterator that paginates through all results of ListUserInstallations.

func (*AppsService) ListUserRepos

func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOptions) (*ListRepositories, *Response, error)

ListUserRepos lists repositories that are accessible to the authenticated user for an installation.

GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#list-repositories-accessible-to-the-user-access-token

func (*AppsService) ListUserReposIter

func (s *AppsService) ListUserReposIter(ctx context.Context, id int64, opts *ListOptions) iter.Seq2[*Repository, error]

ListUserReposIter returns an iterator that paginates through all results of ListUserRepos.

func (*AppsService) RedeliverHookDelivery

func (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error)

RedeliverHookDelivery redelivers a delivery for an App webhook.

GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#redeliver-a-delivery-for-an-app-webhook

func (*AppsService) RemoveRepository

func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error)

RemoveRepository removes a single repository from an installation.

GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#remove-a-repository-from-an-app-installation

func (*AppsService) RevokeInstallationToken

func (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error)

RevokeInstallationToken revokes an installation token.

GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#revoke-an-installation-access-token

func (*AppsService) SuspendInstallation

func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Response, error)

SuspendInstallation suspends the specified installation.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#suspend-an-app-installation

func (*AppsService) UnsuspendInstallation

func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Response, error)

UnsuspendInstallation unsuspends the specified installation.

GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#unsuspend-an-app-installation

func (*AppsService) UpdateHookConfig

func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error)

UpdateHookConfig updates the webhook configuration for a GitHub App. The underlying transport must be authenticated as an app.

GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-app

type ArchiveFormat

type ArchiveFormat string

ArchiveFormat is used to define the archive type when calling GetArchiveLink.

const (
	// Tarball specifies an archive in gzipped tar format.
	Tarball ArchiveFormat = "tarball"

	// Zipball specifies an archive in zip format.
	Zipball ArchiveFormat = "zipball"
)

type ArchivedAt

type ArchivedAt struct {
	From *Timestamp `json:"from,omitempty"`
	To   *Timestamp `json:"to,omitempty"`
}

ArchivedAt represents an archiving date change.

func (*ArchivedAt) GetFrom

func (a *ArchivedAt) GetFrom() Timestamp

GetFrom returns the From field if it's non-nil, zero value otherwise.

func (*ArchivedAt) GetTo

func (a *ArchivedAt) GetTo() Timestamp

GetTo returns the To field if it's non-nil, zero value otherwise.

type Artifact

type Artifact struct {
	ID                 *int64     `json:"id,omitempty"`
	NodeID             *string    `json:"node_id,omitempty"`
	Name               *string    `json:"name,omitempty"`
	SizeInBytes        *int64     `json:"size_in_bytes,omitempty"`
	URL                *string    `json:"url,omitempty"`
	ArchiveDownloadURL *string    `json:"archive_download_url,omitempty"`
	Expired            *bool      `json:"expired,omitempty"`
	CreatedAt          *Timestamp `json:"created_at,omitempty"`
	UpdatedAt          *Timestamp `json:"updated_at,omitempty"`
	ExpiresAt          *Timestamp `json:"expires_at,omitempty"`
	// Digest is the SHA256 digest of the artifact.
	// This field will only be populated on artifacts uploaded with upload-artifact v4 or newer.
	// For older versions, this field will be null.
	Digest      *string              `json:"digest,omitempty"`
	WorkflowRun *ArtifactWorkflowRun `json:"workflow_run,omitempty"`
}

Artifact represents a GitHub artifact. Artifacts allow sharing data between jobs in a workflow and provide storage for data once a workflow is complete.

GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28

func (*Artifact) GetArchiveDownloadURL

func (a *Artifact) GetArchiveDownloadURL() string

GetArchiveDownloadURL returns the ArchiveDownloadURL field if it's non-nil, zero value otherwise.

func (*Artifact) GetCreatedAt

func (a *Artifact) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Artifact) GetDigest

func (a *Artifact) GetDigest() string

GetDigest returns the Digest field if it's non-nil, zero value otherwise.

func (*Artifact) GetExpired

func (a *Artifact) GetExpired() bool

GetExpired returns the Expired field if it's non-nil, zero value otherwise.

func (*Artifact) GetExpiresAt

func (a *Artifact) GetExpiresAt() Timestamp

GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise.

func (*Artifact) GetID

func (a *Artifact) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Artifact) GetName

func (a *Artifact) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Artifact) GetNodeID

func (a *Artifact) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*Artifact) GetSizeInBytes

func (a *Artifact) GetSizeInBytes() int64

GetSizeInBytes returns the SizeInBytes field if it's non-nil, zero value otherwise.

func (*Artifact) GetURL

func (a *Artifact) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Artifact) GetUpdatedAt

func (a *Artifact) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (*Artifact) GetWorkflowRun

func (a *Artifact) GetWorkflowRun() *ArtifactWorkflowRun

GetWorkflowRun returns the WorkflowRun field.

type ArtifactDeploymentRecord

type ArtifactDeploymentRecord struct {
	ID                  *int64                  `json:"id,omitempty"`
	Digest              *string                 `json:"digest,omitempty"`
	LogicalEnvironment  *string                 `json:"logical_environment,omitempty"`
	PhysicalEnvironment *string                 `json:"physical_environment,omitempty"`
	Cluster             *string                 `json:"cluster,omitempty"`
	DeploymentName      *string                 `json:"deployment_name,omitempty"`
	Tags                map[string]string       `json:"tags,omitempty"`
	RuntimeRisks        []DeploymentRuntimeRisk `json:"runtime_risks,omitempty"`
	AttestationID       *int64                  `json:"attestation_id,omitempty"`
	CreatedAt           *Timestamp              `json:"created_at,omitempty"`
	UpdatedAt           *Timestamp              `json:"updated_at,omitempty"`
}

ArtifactDeploymentRecord represents a GitHub artifact deployment record.

func (*ArtifactDeploymentRecord) GetAttestationID

func (a *ArtifactDeploymentRecord) GetAttestationID() int64

GetAttestationID returns the AttestationID field if it's non-nil, zero value otherwise.

func (*ArtifactDeploymentRecord) GetCluster

func (a *ArtifactDeploymentRecord) GetCluster() string

GetCluster returns the Cluster field if it's non-nil, zero value otherwise.

func (*ArtifactDeploymentRecord) GetCreatedAt

func (a *ArtifactDeploymentRecord) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*ArtifactDeploymentRecord) GetDeploymentName

func (a *ArtifactDeploymentRecord) GetDeploymentName() string

GetDeploymentName returns the DeploymentName field if it's non-nil, zero value otherwise.

func (*ArtifactDeploymentRecord) GetDigest

func (a *ArtifactDeploymentRecord) GetDigest() string

GetDigest returns the Digest field if it's non-nil, zero value otherwise.

func (*ArtifactDeploymentRecord) GetID

func (a *ArtifactDeploymentRecord) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*ArtifactDeploymentRecord) GetLogicalEnvironment

func (a *ArtifactDeploymentRecord) GetLogicalEnvironment() string

GetLogicalEnvironment returns the LogicalEnvironment field if it's non-nil, zero value otherwise.

func (*ArtifactDeploymentRecord) GetPhysicalEnvironment

func (a *ArtifactDeploymentRecord) GetPhysicalEnvironment() string

GetPhysicalEnvironment returns the PhysicalEnvironment field if it's non-nil, zero value otherwise.

func (*ArtifactDeploymentRecord) GetRuntimeRisks

func (a *ArtifactDeploymentRecord) GetRuntimeRisks() []DeploymentRuntimeRisk

GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise.

func (*ArtifactDeploymentRecord) GetTags

func (a *ArtifactDeploymentRecord) GetTags() map[string]string

GetTags returns the Tags map if it's non-nil, an empty map otherwise.

func (*ArtifactDeploymentRecord) GetUpdatedAt

func (a *ArtifactDeploymentRecord) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type ArtifactDeploymentResponse

type ArtifactDeploymentResponse struct {
	TotalCount        *int                        `json:"total_count,omitempty"`
	DeploymentRecords []*ArtifactDeploymentRecord `json:"deployment_records,omitempty"`
}

ArtifactDeploymentResponse represents the response for deployment records.

func (*ArtifactDeploymentResponse) GetDeploymentRecords

func (a *ArtifactDeploymentResponse) GetDeploymentRecords() []*ArtifactDeploymentRecord

GetDeploymentRecords returns the DeploymentRecords slice if it's non-nil, nil otherwise.

func (*ArtifactDeploymentResponse) GetTotalCount

func (a *ArtifactDeploymentResponse) GetTotalCount() int

GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.

type ArtifactList

type ArtifactList struct {
	TotalCount *int64      `json:"total_count,omitempty"`
	Artifacts  []*Artifact `json:"artifacts,omitempty"`
}

ArtifactList represents a list of GitHub artifacts.

GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#artifacts

func (*ArtifactList) GetArtifacts

func (a *ArtifactList) GetArtifacts() []*Artifact

GetArtifacts returns the Artifacts slice if it's non-nil, nil otherwise.

func (*ArtifactList) GetTotalCount

func (a *ArtifactList) GetTotalCount() int64

GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.

type ArtifactPeriod

type ArtifactPeriod struct {
	Days               *int `json:"days,omitempty"`
	MaximumAllowedDays *int `json:"maximum_allowed_days,omitempty"`
}

ArtifactPeriod represents the period for which the artifact and log of a workflow run is retained.

func (*ArtifactPeriod) GetDays

func (a *ArtifactPeriod) GetDays() int

GetDays returns the Days field if it's non-nil, zero value otherwise.

func (*ArtifactPeriod) GetMaximumAllowedDays

func (a *ArtifactPeriod) GetMaximumAllowedDays() int

GetMaximumAllowedDays returns the MaximumAllowedDays field if it's non-nil, zero value otherwise.

func (ArtifactPeriod) String

func (a ArtifactPeriod) String() string

type ArtifactPeriodOpt

type ArtifactPeriodOpt struct {
	Days *int `json:"days,omitempty"`
}

ArtifactPeriodOpt is used to specify the retention period of artifacts and logs in a workflow run.

func (*ArtifactPeriodOpt) GetDays

func (a *ArtifactPeriodOpt) GetDays() int

GetDays returns the Days field if it's non-nil, zero value otherwise.

type ArtifactStorageRecord

type ArtifactStorageRecord struct {
	ID          *int64     `json:"id,omitempty"`
	Name        *string    `json:"name,omitempty"`
	Digest      *string    `json:"digest,omitempty"`
	ArtifactURL *string    `json:"artifact_url,omitempty"`
	RegistryURL *string    `json:"registry_url,omitempty"`
	Repository  *string    `json:"repository,omitempty"`
	Status      *string    `json:"status,omitempty"`
	CreatedAt   *Timestamp `json:"created_at,omitempty"`
	UpdatedAt   *Timestamp `json:"updated_at,omitempty"`
}

ArtifactStorageRecord represents a GitHub artifact storage record.

func (*ArtifactStorageRecord) GetArtifactURL

func (a *ArtifactStorageRecord) GetArtifactURL() string

GetArtifactURL returns the ArtifactURL field if it's non-nil, zero value otherwise.

func (*ArtifactStorageRecord) GetCreatedAt

func (a *ArtifactStorageRecord) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*ArtifactStorageRecord) GetDigest

func (a *ArtifactStorageRecord) GetDigest() string

GetDigest returns the Digest field if it's non-nil, zero value otherwise.

func (*ArtifactStorageRecord) GetID

func (a *ArtifactStorageRecord) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*ArtifactStorageRecord) GetName

func (a *ArtifactStorageRecord) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*ArtifactStorageRecord) GetRegistryURL

func (a *ArtifactStorageRecord) GetRegistryURL() string

GetRegistryURL returns the RegistryURL field if it's non-nil, zero value otherwise.

func (*ArtifactStorageRecord) GetRepository

func (a *ArtifactStorageRecord) GetRepository() string

GetRepository returns the Repository field if it's non-nil, zero value otherwise.

func (*ArtifactStorageRecord) GetStatus

func (a *ArtifactStorageRecord) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*ArtifactStorageRecord) GetUpdatedAt

func (a *ArtifactStorageRecord) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type ArtifactStorageResponse

type ArtifactStorageResponse struct {
	TotalCount     *int                     `json:"total_count,omitempty"`
	StorageRecords []*ArtifactStorageRecord `json:"storage_records,omitempty"`
}

ArtifactStorageResponse represents the response for storage records.

func (*ArtifactStorageResponse) GetStorageRecords

func (a *ArtifactStorageResponse) GetStorageRecords() []*ArtifactStorageRecord

GetStorageRecords returns the StorageRecords slice if it's non-nil, nil otherwise.

func (*ArtifactStorageResponse) GetTotalCount

func (a *ArtifactStorageResponse) GetTotalCount() int

GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.

type ArtifactWorkflowRun

type ArtifactWorkflowRun struct {
	ID               *int64  `json:"id,omitempty"`
	RepositoryID     *int64  `json:"repository_id,omitempty"`
	HeadRepositoryID *int64  `json:"head_repository_id,omitempty"`
	HeadBranch       *string `json:"head_branch,omitempty"`
	HeadSHA          *string `json:"head_sha,omitempty"`
}

ArtifactWorkflowRun represents a GitHub artifact's workflow run.

GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28

func (*ArtifactWorkflowRun) GetHeadBranch

func (a *ArtifactWorkflowRun) GetHeadBranch() string

GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise.

func (*ArtifactWorkflowRun) GetHeadRepositoryID

func (a *ArtifactWorkflowRun) GetHeadRepositoryID() int64

GetHeadRepositoryID returns the HeadRepositoryID field if it's non-nil, zero value otherwise.

func (*ArtifactWorkflowRun) GetHeadSHA

func (a *ArtifactWorkflowRun) GetHeadSHA() string

GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.

func (*ArtifactWorkflowRun) GetID

func (a *ArtifactWorkflowRun) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*ArtifactWorkflowRun) GetRepositoryID

func (a *ArtifactWorkflowRun) GetRepositoryID() int64

GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise.

type AssignmentGrade

type AssignmentGrade struct {
	AssignmentName        *string    `json:"assignment_name,omitempty"`
	AssignmentURL         *string    `json:"assignment_url,omitempty"`
	StarterCodeURL        *string    `json:"starter_code_url,omitempty"`
	GithubUsername        *string    `json:"github_username,omitempty"`
	RosterIdentifier      *string    `json:"roster_identifier,omitempty"`
	StudentRepositoryName *string    `json:"student_repository_name,omitempty"`
	StudentRepositoryURL  *string    `json:"student_repository_url,omitempty"`
	SubmissionTimestamp   *Timestamp `json:"submission_timestamp,omitempty"`
	PointsAwarded         *int       `json:"points_awarded,omitempty"`
	PointsAvailable       *int       `json:"points_available,omitempty"`
	GroupName             *string    `json:"group_name,omitempty"`
}

AssignmentGrade represents a GitHub Classroom assignment grade.

func (*AssignmentGrade) GetAssignmentName

func (a *AssignmentGrade) GetAssignmentName() string

GetAssignmentName returns the AssignmentName field if it's non-nil, zero value otherwise.

func (*AssignmentGrade) GetAssignmentURL

func (a *AssignmentGrade) GetAssignmentURL() string

GetAssignmentURL returns the AssignmentURL field if it's non-nil, zero value otherwise.

func (*AssignmentGrade) GetGithubUsername

func (a *AssignmentGrade) GetGithubUsername() string

GetGithubUsername returns the GithubUsername field if it's non-nil, zero value otherwise.

func (*AssignmentGrade) GetGroupName

func (a *AssignmentGrade) GetGroupName() string

GetGroupName returns the GroupName field if it's non-nil, zero value otherwise.

func (*AssignmentGrade) GetPointsAvailable

func (a *AssignmentGrade) GetPointsAvailable() int

GetPointsAvailable returns the PointsAvailable field if it's non-nil, zero value otherwise.

func (*AssignmentGrade) GetPointsAwarded

func (a *AssignmentGrade) GetPointsAwarded() int

GetPointsAwarded returns the PointsAwarded field if it's non-nil, zero value otherwise.

func (*AssignmentGrade) GetRosterIdentifier

func (a *AssignmentGrade) GetRosterIdentifier() string

GetRosterIdentifier returns the RosterIdentifier field if it's non-nil, zero value otherwise.

func (*AssignmentGrade) GetStarterCodeURL

func (a *AssignmentGrade) GetStarterCodeURL() string

GetStarterCodeURL returns the StarterCodeURL field if it's non-nil, zero value otherwise.

func (*AssignmentGrade) GetStudentRepositoryName

func (a *AssignmentGrade) GetStudentRepositoryName() string

GetStudentRepositoryName returns the StudentRepositoryName field if it's non-nil, zero value otherwise.

func (*AssignmentGrade) GetStudentRepositoryURL

func (a *AssignmentGrade) GetStudentRepositoryURL() string

GetStudentRepositoryURL returns the StudentRepositoryURL field if it's non-nil, zero value otherwise.

func (*AssignmentGrade) GetSubmissionTimestamp

func (a *AssignmentGrade) GetSubmissionTimestamp() Timestamp

GetSubmissionTimestamp returns the SubmissionTimestamp field if it's non-nil, zero value otherwise.

func (AssignmentGrade) String

func (g AssignmentGrade) String() string

type Attachment

type Attachment struct {
	ID    *int64  `json:"id,omitempty"`
	Title *string `json:"title,omitempty"`
	Body  *string `json:"body,omitempty"`
}

Attachment represents a GitHub Apps attachment.

func (*Attachment) GetBody

func (a *Attachment) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*Attachment) GetID

func (a *Attachment) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Attachment) GetTitle

func (a *Attachment) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

type Attestation

type Attestation struct {
	// The attestation's Sigstore Bundle.
	// Refer to the sigstore bundle specification for more info:
	// https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto
	Bundle       json.RawMessage `json:"bundle"`
	RepositoryID int64           `json:"repository_id"`
}

Attestation represents an artifact attestation associated with a repository. The provided bundle can be used to verify the provenance of artifacts.

https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds

func (*Attestation) GetBundle

func (a *Attestation) GetBundle() json.RawMessage

GetBundle returns the Bundle field.

func (*Attestation) GetRepositoryID

func (a *Attestation) GetRepositoryID() int64

GetRepositoryID returns the RepositoryID field.

type AttestationsResponse

type AttestationsResponse struct {
	Attestations []*Attestation `json:"attestations"`
}

AttestationsResponse represents a collection of artifact attestations.

func (*AttestationsResponse) GetAttestations

func (a *AttestationsResponse) GetAttestations() []*Attestation

GetAttestations returns the Attestations slice if it's non-nil, nil otherwise.

type AuditEntry

type AuditEntry struct {
	Action                   *string        `json:"action,omitempty"` // The name of the action that was performed, for example `user.login` or `repo.create`.
	Actor                    *string        `json:"actor,omitempty"`  // The actor who performed the action.
	ActorID                  *int64         `json:"actor_id,omitempty"`
	ActorLocation            *ActorLocation `json:"actor_location,omitempty"`
	Business                 *string        `json:"business,omitempty"`
	BusinessID               *int64         `json:"business_id,omitempty"`
	CreatedAt                *Timestamp     `json:"created_at,omitempty"`
	DocumentID               *string        `json:"_document_id,omitempty"`
	ExternalIdentityNameID   *string        `json:"external_identity_nameid,omitempty"`
	ExternalIdentityUsername *string        `json:"external_identity_username,omitempty"`
	HashedToken              *string        `json:"hashed_token,omitempty"`
	Org                      *string        `json:"org,omitempty"`
	OrgID                    *int64         `json:"org_id,omitempty"`
	Timestamp                *Timestamp     `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).
	TokenID                  *int64         `json:"token_id,omitempty"`
	TokenScopes              *string        `json:"token_scopes,omitempty"`
	User                     *string        `json:"user,omitempty"` // The user that was affected by the action performed (if available).
	UserID                   *int64         `json:"user_id,omitempty"`

	// Some events types have a data field that contains additional information about the event.
	Data map[string]any `json:"data,omitempty"`

	// All fields that are not explicitly defined in the struct are captured here.
	AdditionalFields map[string]any `json:"-"`
}

AuditEntry describes the fields that may be represented by various audit-log "action" entries. There are many other fields that may be present depending on the action. You can access those in AdditionalFields. For a list of actions see - https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#audit-log-actions

func (*AuditEntry) GetAction

func (a *AuditEntry) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetActor

func (a *AuditEntry) GetActor() string

GetActor returns the Actor field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetActorID

func (a *AuditEntry) GetActorID() int64

GetActorID returns the ActorID field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetActorLocation

func (a *AuditEntry) GetActorLocation() *ActorLocation

GetActorLocation returns the ActorLocation field.

func (*AuditEntry) GetAdditionalFields

func (a *AuditEntry) GetAdditionalFields() map[string]any

GetAdditionalFields returns the AdditionalFields map if it's non-nil, an empty map otherwise.

func (*AuditEntry) GetBusiness

func (a *AuditEntry) GetBusiness() string

GetBusiness returns the Business field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetBusinessID

func (a *AuditEntry) GetBusinessID() int64

GetBusinessID returns the BusinessID field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetCreatedAt

func (a *AuditEntry) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetData

func (a *AuditEntry) GetData() map[string]any

GetData returns the Data map if it's non-nil, an empty map otherwise.

func (*AuditEntry) GetDocumentID

func (a *AuditEntry) GetDocumentID() string

GetDocumentID returns the DocumentID field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetExternalIdentityNameID

func (a *AuditEntry) GetExternalIdentityNameID() string

GetExternalIdentityNameID returns the ExternalIdentityNameID field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetExternalIdentityUsername

func (a *AuditEntry) GetExternalIdentityUsername() string

GetExternalIdentityUsername returns the ExternalIdentityUsername field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetHashedToken

func (a *AuditEntry) GetHashedToken() string

GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetOrg

func (a *AuditEntry) GetOrg() string

GetOrg returns the Org field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetOrgID

func (a *AuditEntry) GetOrgID() int64

GetOrgID returns the OrgID field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetTimestamp

func (a *AuditEntry) GetTimestamp() Timestamp

GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetTokenID

func (a *AuditEntry) GetTokenID() int64

GetTokenID returns the TokenID field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetTokenScopes

func (a *AuditEntry) GetTokenScopes() string

GetTokenScopes returns the TokenScopes field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetUser

func (a *AuditEntry) GetUser() string

GetUser returns the User field if it's non-nil, zero value otherwise.

func (*AuditEntry) GetUserID

func (a *AuditEntry) GetUserID() int64

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

func (AuditEntry) MarshalJSON

func (a AuditEntry) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*AuditEntry) UnmarshalJSON

func (a *AuditEntry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type AuditLogStream

type AuditLogStream struct {
	ID            int64      `json:"id"`
	StreamType    string     `json:"stream_type"`
	StreamDetails string     `json:"stream_details"`
	Enabled       bool       `json:"enabled"`
	CreatedAt     Timestamp  `json:"created_at"`
	UpdatedAt     Timestamp  `json:"updated_at"`
	PausedAt      *Timestamp `json:"paused_at,omitempty"`
}

AuditLogStream represents an audit log stream configuration for an enterprise.

func (*AuditLogStream) GetCreatedAt

func (a *AuditLogStream) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field.

func (*AuditLogStream) GetEnabled

func (a *AuditLogStream) GetEnabled() bool

GetEnabled returns the Enabled field.

func (*AuditLogStream) GetID

func (a *AuditLogStream) GetID() int64

GetID returns the ID field.

func (*AuditLogStream) GetPausedAt

func (a *AuditLogStream) GetPausedAt() Timestamp

GetPausedAt returns the PausedAt field if it's non-nil, zero value otherwise.

func (*AuditLogStream) GetStreamDetails

func (a *AuditLogStream) GetStreamDetails() string

GetStreamDetails returns the StreamDetails field.

func (*AuditLogStream) GetStreamType

func (a *AuditLogStream) GetStreamType() string

GetStreamType returns the StreamType field.

func (*AuditLogStream) GetUpdatedAt

func (a *AuditLogStream) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field.

type AuditLogStreamConfig

type AuditLogStreamConfig struct {
	Enabled        bool                       `json:"enabled"`
	StreamType     string                     `json:"stream_type"`
	VendorSpecific AuditLogStreamVendorConfig `json:"vendor_specific"`
}

AuditLogStreamConfig represents a configuration for creating or updating an audit log stream.

func NewAmazonS3AccessKeysStreamConfig

func NewAmazonS3AccessKeysStreamConfig(enabled bool, cfg *AmazonS3AccessKeysConfig) *AuditLogStreamConfig

NewAmazonS3AccessKeysStreamConfig returns an AuditLogStreamConfig for Amazon S3 with access key auth.

func NewAmazonS3OIDCStreamConfig

func NewAmazonS3OIDCStreamConfig(enabled bool, cfg *AmazonS3OIDCConfig) *AuditLogStreamConfig

NewAmazonS3OIDCStreamConfig returns an AuditLogStreamConfig for Amazon S3 with OIDC auth.

func NewAzureBlobStreamConfig

func NewAzureBlobStreamConfig(enabled bool, cfg *AzureBlobConfig) *AuditLogStreamConfig

NewAzureBlobStreamConfig returns an AuditLogStreamConfig for Azure Blob Storage.

func NewAzureHubStreamConfig

func NewAzureHubStreamConfig(enabled bool, cfg *AzureHubConfig) *AuditLogStreamConfig

NewAzureHubStreamConfig returns an AuditLogStreamConfig for Azure Event Hubs.

func NewDatadogStreamConfig

func NewDatadogStreamConfig(enabled bool, cfg *DatadogConfig) *AuditLogStreamConfig

NewDatadogStreamConfig returns an AuditLogStreamConfig for Datadog.

func NewGoogleCloudStreamConfig

func NewGoogleCloudStreamConfig(enabled bool, cfg *GoogleCloudConfig) *AuditLogStreamConfig

NewGoogleCloudStreamConfig returns an AuditLogStreamConfig for Google Cloud Storage.

func NewHecStreamConfig

func NewHecStreamConfig(enabled bool, cfg *HecConfig) *AuditLogStreamConfig

NewHecStreamConfig returns an AuditLogStreamConfig for an HTTPS Event Collector endpoint.

func NewSplunkStreamConfig

func NewSplunkStreamConfig(enabled bool, cfg *SplunkConfig) *AuditLogStreamConfig

NewSplunkStreamConfig returns an AuditLogStreamConfig for Splunk.

func (*AuditLogStreamConfig) GetEnabled

func (a *AuditLogStreamConfig) GetEnabled() bool

GetEnabled returns the Enabled field.

func (*AuditLogStreamConfig) GetStreamType

func (a *AuditLogStreamConfig) GetStreamType() string

GetStreamType returns the StreamType field.

func (*AuditLogStreamConfig) GetVendorSpecific

func (a *AuditLogStreamConfig) GetVendorSpecific() AuditLogStreamVendorConfig

GetVendorSpecific returns the VendorSpecific field.

type AuditLogStreamKey

type AuditLogStreamKey struct {
	KeyID string `json:"key_id"`
	Key   string `json:"key"`
}

AuditLogStreamKey represents the public key used to encrypt secrets for audit log streaming.

func (*AuditLogStreamKey) GetKey

func (a *AuditLogStreamKey) GetKey() string

GetKey returns the Key field.

func (*AuditLogStreamKey) GetKeyID

func (a *AuditLogStreamKey) GetKeyID() string

GetKeyID returns the KeyID field.

type AuditLogStreamVendorConfig

type AuditLogStreamVendorConfig interface {
	// contains filtered or unexported methods
}

AuditLogStreamVendorConfig is a sealed marker interface for vendor-specific audit log stream configurations. Only this package can define implementations.

type Authorization

type Authorization struct {
	ID             *int64            `json:"id,omitempty"`
	URL            *string           `json:"url,omitempty"`
	Scopes         []Scope           `json:"scopes,omitempty"`
	Token          *string           `json:"token,omitempty"`
	TokenLastEight *string           `json:"token_last_eight,omitempty"`
	HashedToken    *string           `json:"hashed_token,omitempty"`
	App            *AuthorizationApp `json:"app,omitempty"`
	Note           *string           `json:"note,omitempty"`
	NoteURL        *string           `json:"note_url,omitempty"`
	UpdatedAt      *Timestamp        `json:"updated_at,omitempty"`
	CreatedAt      *Timestamp        `json:"created_at,omitempty"`
	Fingerprint    *string           `json:"fingerprint,omitempty"`

	// User is only populated by the Check and Reset methods.
	User *User `json:"user,omitempty"`
}

Authorization represents an individual GitHub authorization.

func (*Authorization) GetApp

func (a *Authorization) GetApp() *AuthorizationApp

GetApp returns the App field.

func (*Authorization) GetCreatedAt

func (a *Authorization) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Authorization) GetFingerprint

func (a *Authorization) GetFingerprint() string

GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.

func (*Authorization) GetHashedToken

func (a *Authorization) GetHashedToken() string

GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise.

func (*Authorization) GetID

func (a *Authorization) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Authorization) GetNote

func (a *Authorization) GetNote() string

GetNote returns the Note field if it's non-nil, zero value otherwise.

func (*Authorization) GetNoteURL

func (a *Authorization) GetNoteURL() string

GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.

func (*Authorization) GetScopes

func (a *Authorization) GetScopes() []Scope

GetScopes returns the Scopes slice if it's non-nil, nil otherwise.

func (*Authorization) GetToken

func (a *Authorization) GetToken() string

GetToken returns the Token field if it's non-nil, zero value otherwise.

func (*Authorization) GetTokenLastEight

func (a *Authorization) GetTokenLastEight() string

GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise.

func (*Authorization) GetURL

func (a *Authorization) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Authorization) GetUpdatedAt

func (a *Authorization) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (*Authorization) GetUser

func (a *Authorization) GetUser() *User

GetUser returns the User field.

func (Authorization) String

func (a Authorization) String() string

type AuthorizationApp

type AuthorizationApp struct {
	URL      *string `json:"url,omitempty"`
	Name     *string `json:"name,omitempty"`
	ClientID *string `json:"client_id,omitempty"`
}

AuthorizationApp represents an individual GitHub app (in the context of authorization).

func (*AuthorizationApp) GetClientID

func (a *AuthorizationApp) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*AuthorizationApp) GetName

func (a *AuthorizationApp) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*AuthorizationApp) GetURL

func (a *AuthorizationApp) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (AuthorizationApp) String

func (a AuthorizationApp) String() string

type AuthorizationRequest

type AuthorizationRequest struct {
	Scopes       []Scope `json:"scopes,omitempty"`
	Note         *string `json:"note,omitempty"`
	NoteURL      *string `json:"note_url,omitempty"`
	ClientID     *string `json:"client_id,omitempty"`
	ClientSecret *string `json:"client_secret,omitempty"`
	Fingerprint  *string `json:"fingerprint,omitempty"`
}

AuthorizationRequest represents a request to create an authorization.

func (*AuthorizationRequest) GetClientID

func (a *AuthorizationRequest) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetClientSecret

func (a *AuthorizationRequest) GetClientSecret() string

GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetFingerprint

func (a *AuthorizationRequest) GetFingerprint() string

GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetNote

func (a *AuthorizationRequest) GetNote() string

GetNote returns the Note field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetNoteURL

func (a *AuthorizationRequest) GetNoteURL() string

GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetScopes

func (a *AuthorizationRequest) GetScopes() []Scope

GetScopes returns the Scopes slice if it's non-nil, nil otherwise.

func (AuthorizationRequest) String

func (a AuthorizationRequest) String() string

type AuthorizationUpdateRequest

type AuthorizationUpdateRequest struct {
	Scopes       []string `json:"scopes,omitempty"`
	AddScopes    []string `json:"add_scopes,omitempty"`
	RemoveScopes []string `json:"remove_scopes,omitempty"`
	Note         *string  `json:"note,omitempty"`
	NoteURL      *string  `json:"note_url,omitempty"`
	Fingerprint  *string  `json:"fingerprint,omitempty"`
}

AuthorizationUpdateRequest represents a request to update an authorization.

Note that for any one update, you must only provide one of the "scopes" fields. That is, you may provide only one of "Scopes", or "AddScopes", or "RemoveScopes".

GitHub API docs: https://docs.github.com/rest/oauth-authorizations?apiVersion=2022-11-28#update-an-existing-authorization

func (*AuthorizationUpdateRequest) GetAddScopes

func (a *AuthorizationUpdateRequest) GetAddScopes() []string

GetAddScopes returns the AddScopes slice if it's non-nil, nil otherwise.

func (*AuthorizationUpdateRequest) GetFingerprint

func (a *AuthorizationUpdateRequest) GetFingerprint() string

GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.

func (*AuthorizationUpdateRequest) GetNote

func (a *AuthorizationUpdateRequest) GetNote() string

GetNote returns the Note field if it's non-nil, zero value otherwise.

func (*AuthorizationUpdateRequest) GetNoteURL

func (a *AuthorizationUpdateRequest) GetNoteURL() string

GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.

func (*AuthorizationUpdateRequest) GetRemoveScopes

func (a *AuthorizationUpdateRequest) GetRemoveScopes() []string

GetRemoveScopes returns the RemoveScopes slice if it's non-nil, nil otherwise.

func (*AuthorizationUpdateRequest) GetScopes

func (a *AuthorizationUpdateRequest) GetScopes() []string

GetScopes returns the Scopes slice if it's non-nil, nil otherwise.

func (AuthorizationUpdateRequest) String

type AuthorizationsService

type AuthorizationsService service

AuthorizationsService handles communication with the authorization related methods of the GitHub API.

This service requires HTTP Basic Authentication; it cannot be accessed using an OAuth token.

GitHub API docs: https://docs.github.com/rest/oauth-authorizations?apiVersion=2022-11-28

func (*AuthorizationsService) Check

func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error)

Check if an OAuth token is valid for a specific app.

Note that this operation requires the use of BasicAuth, but where the username is the OAuth application clientID, and the password is its clientSecret. Invalid tokens will return a 404 Not Found.

The returned Authorization.User field will be populated.

GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#check-a-token

func (*AuthorizationsService) CreateImpersonation

func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error)

CreateImpersonation creates an impersonation OAuth token.

This requires admin permissions. With the returned Authorization.Token you can e.g. create or delete a user's public SSH key. NOTE: creating a new token automatically revokes an existing one.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#create-an-impersonation-oauth-token

func (*AuthorizationsService) DeleteGrant

func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, accessToken string) (*Response, error)

DeleteGrant deletes an OAuth application grant. Deleting an application's grant will also delete all OAuth tokens associated with the application for the user.

GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#delete-an-app-authorization

func (*AuthorizationsService) DeleteImpersonation

func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error)

DeleteImpersonation deletes an impersonation OAuth token.

NOTE: there can be only one at a time.

GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#delete-an-impersonation-oauth-token

func (*AuthorizationsService) Reset

func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error)

Reset is used to reset a valid OAuth token without end user involvement. Applications must save the "token" property in the response, because changes take effect immediately.

Note that this operation requires the use of BasicAuth, but where the username is the OAuth application clientID, and the password is its clientSecret. Invalid tokens will return a 404 Not Found.

The returned Authorization.User field will be populated.

GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#reset-a-token

func (*AuthorizationsService) Revoke

func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToken string) (*Response, error)

Revoke an authorization for an application.

Note that this operation requires the use of BasicAuth, but where the username is the OAuth application clientID, and the password is its clientSecret. Invalid tokens will return a 404 Not Found.

GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#delete-an-app-token

type AuthorizedActorNames

type AuthorizedActorNames struct {
	From []string `json:"from,omitempty"`
}

AuthorizedActorNames represents who are authorized to edit the branch protection rules.

func (*AuthorizedActorNames) GetFrom

func (a *AuthorizedActorNames) GetFrom() []string

GetFrom returns the From slice if it's non-nil, nil otherwise.

type AuthorizedActorsOnly

type AuthorizedActorsOnly struct {
	From *bool `json:"from,omitempty"`
}

AuthorizedActorsOnly represents if the branch rule can be edited by authorized actors only.

func (*AuthorizedActorsOnly) GetFrom

func (a *AuthorizedActorsOnly) GetFrom() bool

GetFrom returns the From field if it's non-nil, zero value otherwise.

type AuthorizedDismissalActorsOnlyChanges

type AuthorizedDismissalActorsOnlyChanges struct {
	From *bool `json:"from,omitempty"`
}

AuthorizedDismissalActorsOnlyChanges represents the changes made to the AuthorizedDismissalActorsOnly policy.

func (*AuthorizedDismissalActorsOnlyChanges) GetFrom

GetFrom returns the From field if it's non-nil, zero value otherwise.

type AutoTriggerCheck

type AutoTriggerCheck struct {
	AppID   *int64 `json:"app_id,omitempty"`  // The id of the GitHub App. (Required.)
	Setting *bool  `json:"setting,omitempty"` // Set to "true" to enable automatic creation of CheckSuite events upon pushes to the repository, or "false" to disable them. Default: "true" (Required.)
}

AutoTriggerCheck enables or disables automatic creation of CheckSuite events upon pushes to the repository.

func (*AutoTriggerCheck) GetAppID

func (a *AutoTriggerCheck) GetAppID() int64

GetAppID returns the AppID field if it's non-nil, zero value otherwise.

func (*AutoTriggerCheck) GetSetting

func (a *AutoTriggerCheck) GetSetting() bool

GetSetting returns the Setting field if it's non-nil, zero value otherwise.

type Autolink struct {
	ID             *int64  `json:"id,omitempty"`
	KeyPrefix      *string `json:"key_prefix,omitempty"`
	URLTemplate    *string `json:"url_template,omitempty"`
	IsAlphanumeric *bool   `json:"is_alphanumeric,omitempty"`
}

Autolink represents autolinks to external resources like Jira issues and Zendesk tickets.

func (*Autolink) GetID

func (a *Autolink) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Autolink) GetIsAlphanumeric

func (a *Autolink) GetIsAlphanumeric() bool

GetIsAlphanumeric returns the IsAlphanumeric field if it's non-nil, zero value otherwise.

func (*Autolink) GetKeyPrefix

func (a *Autolink) GetKeyPrefix() string

GetKeyPrefix returns the KeyPrefix field if it's non-nil, zero value otherwise.

func (*Autolink) GetURLTemplate

func (a *Autolink) GetURLTemplate() string

GetURLTemplate returns the URLTemplate field if it's non-nil, zero value otherwise.

type AutolinkOptions

type AutolinkOptions struct {
	KeyPrefix      *string `json:"key_prefix,omitempty"`
	URLTemplate    *string `json:"url_template,omitempty"`
	IsAlphanumeric *bool   `json:"is_alphanumeric,omitempty"`
}

AutolinkOptions specifies parameters for RepositoriesService.AddAutolink method.

func (*AutolinkOptions) GetIsAlphanumeric

func (a *AutolinkOptions) GetIsAlphanumeric() bool

GetIsAlphanumeric returns the IsAlphanumeric field if it's non-nil, zero value otherwise.

func (*AutolinkOptions) GetKeyPrefix

func (a *AutolinkOptions) GetKeyPrefix() string

GetKeyPrefix returns the KeyPrefix field if it's non-nil, zero value otherwise.

func (*AutolinkOptions) GetURLTemplate

func (a *AutolinkOptions) GetURLTemplate() string

GetURLTemplate returns the URLTemplate field if it's non-nil, zero value otherwise.

type AutomatedSecurityFixes

type AutomatedSecurityFixes struct {
	Enabled *bool `json:"enabled"`
	Paused  *bool `json:"paused"`
}

AutomatedSecurityFixes represents their status.

func (*AutomatedSecurityFixes) GetEnabled

func (a *AutomatedSecurityFixes) GetEnabled() bool

GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.

func (*AutomatedSecurityFixes) GetPaused

func (a *AutomatedSecurityFixes) GetPaused() bool

GetPaused returns the Paused field if it's non-nil, zero value otherwise.

type AzureBlobConfig

type AzureBlobConfig struct {
	KeyID           string `json:"key_id"`
	EncryptedSASURL string `json:"encrypted_sas_url"`
	Container       string `json:"container"`
}

AzureBlobConfig represents vendor-specific config for Azure Blob Storage.

func (*AzureBlobConfig) GetContainer

func (a *AzureBlobConfig) GetContainer() string

GetContainer returns the Container field.

func (*AzureBlobConfig) GetEncryptedSASURL

func (a *AzureBlobConfig) GetEncryptedSASURL() string

GetEncryptedSASURL returns the EncryptedSASURL field.

func (*AzureBlobConfig) GetKeyID

func (a *AzureBlobConfig) GetKeyID() string

GetKeyID returns the KeyID field.

type AzureHubConfig

type AzureHubConfig struct {
	Name                string `json:"name"`
	EncryptedConnstring string `json:"encrypted_connstring"`
	KeyID               string `json:"key_id"`
}

AzureHubConfig represents vendor-specific config for Azure Event Hubs.

func (*AzureHubConfig) GetEncryptedConnstring

func (a *AzureHubConfig) GetEncryptedConnstring() string

GetEncryptedConnstring returns the EncryptedConnstring field.

func (*AzureHubConfig) GetKeyID

func (a *AzureHubConfig) GetKeyID() string

GetKeyID returns the KeyID field.

func (*AzureHubConfig) GetName

func (a *AzureHubConfig) GetName() string

GetName returns the Name field.

type BasicAuthTransport

type BasicAuthTransport struct {
	Username string // GitHub username
	Password string // GitHub password
	OTP      string // one-time password for users with two-factor auth enabled

	// Transport is the underlying HTTP transport to use when making requests.
	// It will default to http.DefaultTransport if nil.
	Transport http.RoundTripper
}

BasicAuthTransport is an http.RoundTripper that authenticates all requests using HTTP Basic Authentication with the provided username and password. It additionally supports users who have two-factor authentication enabled on their GitHub account.

func (*BasicAuthTransport) Client

func (t *BasicAuthTransport) Client() *http.Client

Client returns an *http.Client that makes requests that are authenticated using HTTP Basic Authentication.

func (*BasicAuthTransport) GetOTP

func (b *BasicAuthTransport) GetOTP() string

GetOTP returns the OTP field.

func (*BasicAuthTransport) GetPassword

func (b *BasicAuthTransport) GetPassword() string

GetPassword returns the Password field.

func (*BasicAuthTransport) GetUsername

func (b *BasicAuthTransport) GetUsername() string

GetUsername returns the Username field.

func (*BasicAuthTransport) RoundTrip

func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface.

type BillingService

type BillingService service

BillingService provides access to the billing related functions in the GitHub API.

GitHub API docs: https://docs.github.com/rest/billing?apiVersion=2022-11-28

func (*BillingService) GetOrganizationAdvancedSecurityActiveCommitters

func (s *BillingService) GetOrganizationAdvancedSecurityActiveCommitters(ctx context.Context, org string, opts *ActiveCommittersListOptions) (*ActiveCommitters, *Response, error)

GetOrganizationAdvancedSecurityActiveCommitters returns the GitHub Advanced Security active committers for an organization per repository.

GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/billing?apiVersion=2022-11-28#get-github-advanced-security-active-committers-for-an-organization

func (*BillingService) GetOrganizationPackagesBilling

func (s *BillingService) GetOrganizationPackagesBilling(ctx context.Context, org string) (*PackagesBilling, *Response, error)

GetOrganizationPackagesBilling returns the free and paid storage used for GitHub Packages in gigabytes for an Org.

This endpoint appears to have disappeared from the official GitHub v3 API documentation website. See https://github.com/google/go-github/issues/3894 for details.

func (*BillingService) GetOrganizationPremiumRequestUsageReport

func (s *BillingService) GetOrganizationPremiumRequestUsageReport(ctx context.Context, org string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error)

GetOrganizationPremiumRequestUsageReport returns a report of the premium request usage for an organization using the enhanced billing platform.

Note: This endpoint is only available to organizations with access to the enhanced billing platform.

GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-premium-request-usage-report-for-an-organization

func (*BillingService) GetOrganizationStorageBilling

func (s *BillingService) GetOrganizationStorageBilling(ctx context.Context, org string) (*StorageBilling, *Response, error)

GetOrganizationStorageBilling returns the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages in gigabytes for an Org.

This endpoint appears to have disappeared from the official GitHub v3 API documentation website. See https://github.com/google/go-github/issues/3894 for details.

func (*BillingService) GetOrganizationUsageReport

func (s *BillingService) GetOrganizationUsageReport(ctx context.Context, org string, opts *UsageReportOptions) (*UsageReport, *Response, error)

GetOrganizationUsageReport returns a report of the total usage for an organization using the enhanced billing platform.

Note: This endpoint is only available to organizations with access to the enhanced billing platform.

GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-usage-report-for-an-organization

func (*BillingService) GetPackagesBilling

func (s *BillingService) GetPackagesBilling(ctx context.Context, user string) (*PackagesBilling, *Response, error)

GetPackagesBilling returns the free and paid storage used for GitHub Packages in gigabytes for a user.

This endpoint appears to have disappeared from the official GitHub v3 API documentation website. See https://github.com/google/go-github/issues/3894 for details.

func (*BillingService) GetPremiumRequestUsageReport

func (s *BillingService) GetPremiumRequestUsageReport(ctx context.Context, user string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error)

GetPremiumRequestUsageReport returns a report of the premium request usage for a user using the enhanced billing platform.

Note: This endpoint is only available to users with access to the enhanced billing platform.

GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-premium-request-usage-report-for-a-user

func (*BillingService) GetStorageBilling

func (s *BillingService) GetStorageBilling(ctx context.Context, user string) (*StorageBilling, *Response, error)

GetStorageBilling returns the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages in gigabytes for a user.

This endpoint appears to have disappeared from the official GitHub v3 API documentation website. See https://github.com/google/go-github/issues/3894 for details.

func (*BillingService) GetUsageReport

func (s *BillingService) GetUsageReport(ctx context.Context, user string, opts *UsageReportOptions) (*UsageReport, *Response, error)

GetUsageReport returns a report of the total usage for a user using the enhanced billing platform.

Note: This endpoint is only available to users with access to the enhanced billing platform.

GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-usage-report-for-a-user

type Blob

type Blob struct {
	Content  *string `json:"content,omitempty"`
	Encoding *string `json:"encoding,omitempty"`
	SHA      *string `json:"sha,omitempty"`
	Size     *int    `json:"size,omitempty"`
	URL      *string `json:"url,omitempty"`
	NodeID   *string `json:"node_id,omitempty"`
}

Blob represents a blob object.

func (*Blob) GetContent

func (b *Blob) GetContent() string

GetContent returns the Content field if it's non-nil, zero value otherwise.

func (*Blob) GetEncoding

func (b *Blob) GetEncoding() string

GetEncoding returns the Encoding field if it's non-nil, zero value otherwise.

func (*Blob) GetNodeID

func (b *Blob) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*Blob) GetSHA

func (b *Blob) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*Blob) GetSize

func (b *Blob) GetSize() int

GetSize returns the Size field if it's non-nil, zero value otherwise.

func (*Blob) GetURL

func (b *Blob) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type BlockCreations

type BlockCreations struct {
	Enabled *bool `json:"enabled,omitempty"`
}

BlockCreations represents whether users can push changes that create branches. If this is true, this setting blocks pushes that create new branches, unless the push is initiated by a user, team, or app which has the ability to push.

func (*BlockCreations) GetEnabled

func (b *BlockCreations) GetEnabled() bool

GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.

type Branch

type Branch struct {
	Name      *string           `json:"name,omitempty"`
	Commit    *RepositoryCommit `json:"commit,omitempty"`
	Protected *bool             `json:"protected,omitempty"`

	// Protection will always be included in APIs which return the
	// 'Branch With Protection' schema such as 'Get a branch', but may
	// not be included in APIs that return the `Short Branch` schema
	// such as 'List branches'. In such cases, if branch protection is
	// enabled, Protected will be `true` but this will be nil, and
	// additional protection details can be obtained by calling GetBranch().
	Protection    *Protection `json:"protection,omitempty"`
	ProtectionURL *string     `json:"protection_url,omitempty"`
}

Branch represents a repository branch.

func (*Branch) GetCommit

func (b *Branch) GetCommit() *RepositoryCommit

GetCommit returns the Commit field.

func (*Branch) GetName

func (b *Branch) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Branch) GetProtected

func (b *Branch) GetProtected() bool

GetProtected returns the Protected field if it's non-nil, zero value otherwise.

func (*Branch) GetProtection

func (b *Branch) GetProtection() *Protection

GetProtection returns the Protection field.

func (*Branch) GetProtectionURL

func (b *Branch) GetProtectionURL() string

GetProtectionURL returns the ProtectionURL field if it's non-nil, zero value otherwise.

type BranchCommit

type BranchCommit struct {
	Name      *string `json:"name,omitempty"`
	Commit    *Commit `json:"commit,omitempty"`
	Protected *bool   `json:"protected,omitempty"`
}

BranchCommit is the result of listing branches with commit SHA.

func (*BranchCommit) GetCommit

func (b *BranchCommit) GetCommit() *Commit

GetCommit returns the Commit field.

func (*BranchCommit) GetName

func (b *BranchCommit) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*BranchCommit) GetProtected

func (b *BranchCommit) GetProtected() bool

GetProtected returns the Protected field if it's non-nil, zero value otherwise.

type BranchListOptions

type BranchListOptions struct {
	// Setting to true returns only protected branches.
	// When set to false, only unprotected branches are returned.
	// Omitting this parameter returns all branches.
	// Default: nil
	Protected *bool `url:"protected,omitempty"`

	ListOptions
}

BranchListOptions specifies the optional parameters to the RepositoriesService.ListBranches method.

func (*BranchListOptions) GetProtected

func (b *BranchListOptions) GetProtected() bool

GetProtected returns the Protected field if it's non-nil, zero value otherwise.

type BranchPolicy

type BranchPolicy struct {
	ProtectedBranches    *bool `json:"protected_branches,omitempty"`
	CustomBranchPolicies *bool `json:"custom_branch_policies,omitempty"`
}

BranchPolicy represents the options for whether a branch deployment policy is applied to this environment.

func (*BranchPolicy) GetCustomBranchPolicies

func (b *BranchPolicy) GetCustomBranchPolicies() bool

GetCustomBranchPolicies returns the CustomBranchPolicies field if it's non-nil, zero value otherwise.

func (*BranchPolicy) GetProtectedBranches

func (b *BranchPolicy) GetProtectedBranches() bool

GetProtectedBranches returns the ProtectedBranches field if it's non-nil, zero value otherwise.

type BranchProtectionConfigurationEvent

type BranchProtectionConfigurationEvent struct {
	Action       *string       `json:"action,omitempty"`
	Repo         *Repository   `json:"repository,omitempty"`
	Org          *Organization `json:"organization,omitempty"`
	Enterprise   *Enterprise   `json:"enterprise,omitempty"`
	Sender       *User         `json:"sender,omitempty"`
	Installation *Installation `json:"installation,omitempty"`
}

BranchProtectionConfigurationEvent is triggered when there is a change to branch protection configurations for a repository. The Webhook event name is "branch_protection_configuration".

GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_configuration

func (*BranchProtectionConfigurationEvent) GetAction

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*BranchProtectionConfigurationEvent) GetEnterprise

func (b *BranchProtectionConfigurationEvent) GetEnterprise() *Enterprise

GetEnterprise returns the Enterprise field.

func (*BranchProtectionConfigurationEvent) GetInstallation

func (b *BranchProtectionConfigurationEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*BranchProtectionConfigurationEvent) GetOrg

GetOrg returns the Org field.

func (*BranchProtectionConfigurationEvent) GetRepo

GetRepo returns the Repo field.

func (*BranchProtectionConfigurationEvent) GetSender

func (b *BranchProtectionConfigurationEvent) GetSender() *User

GetSender returns the Sender field.

type BranchProtectionRule

type BranchProtectionRule struct {
	ID                                       *int64     `json:"id,omitempty"`
	RepositoryID                             *int64     `json:"repository_id,omitempty"`
	Name                                     *string    `json:"name,omitempty"`
	CreatedAt                                *Timestamp `json:"created_at,omitempty"`
	UpdatedAt                                *Timestamp `json:"updated_at,omitempty"`
	PullRequestReviewsEnforcementLevel       *string    `json:"pull_request_reviews_enforcement_level,omitempty"`
	RequiredApprovingReviewCount             *int       `json:"required_approving_review_count,omitempty"`
	DismissStaleReviewsOnPush                *bool      `json:"dismiss_stale_reviews_on_push,omitempty"`
	AuthorizedDismissalActorsOnly            *bool      `json:"authorized_dismissal_actors_only,omitempty"`
	IgnoreApprovalsFromContributors          *bool      `json:"ignore_approvals_from_contributors,omitempty"`
	RequireCodeOwnerReview                   *bool      `json:"require_code_owner_review,omitempty"`
	RequiredStatusChecks                     []string   `json:"required_status_checks,omitempty"`
	RequiredStatusChecksEnforcementLevel     *string    `json:"required_status_checks_enforcement_level,omitempty"`
	StrictRequiredStatusChecksPolicy         *bool      `json:"strict_required_status_checks_policy,omitempty"`
	SignatureRequirementEnforcementLevel     *string    `json:"signature_requirement_enforcement_level,omitempty"`
	LinearHistoryRequirementEnforcementLevel *string    `json:"linear_history_requirement_enforcement_level,omitempty"`
	AdminEnforced                            *bool      `json:"admin_enforced,omitempty"`
	AllowForcePushesEnforcementLevel         *string    `json:"allow_force_pushes_enforcement_level,omitempty"`
	AllowDeletionsEnforcementLevel           *string    `json:"allow_deletions_enforcement_level,omitempty"`
	MergeQueueEnforcementLevel               *string    `json:"merge_queue_enforcement_level,omitempty"`
	RequiredDeploymentsEnforcementLevel      *string    `json:"required_deployments_enforcement_level,omitempty"`
	RequiredConversationResolutionLevel      *string    `json:"required_conversation_resolution_level,omitempty"`
	AuthorizedActorsOnly                     *bool      `json:"authorized_actors_only,omitempty"`
	AuthorizedActorNames                     []string   `json:"authorized_actor_names,omitempty"`
	RequireLastPushApproval                  *bool      `json:"require_last_push_approval,omitempty"`
}

BranchProtectionRule represents the rule applied to a repositories branch.

func (*BranchProtectionRule) GetAdminEnforced

func (b *BranchProtectionRule) GetAdminEnforced() bool

GetAdminEnforced returns the AdminEnforced field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetAllowDeletionsEnforcementLevel

func (b *BranchProtectionRule) GetAllowDeletionsEnforcementLevel() string

GetAllowDeletionsEnforcementLevel returns the AllowDeletionsEnforcementLevel field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetAllowForcePushesEnforcementLevel

func (b *BranchProtectionRule) GetAllowForcePushesEnforcementLevel() string

GetAllowForcePushesEnforcementLevel returns the AllowForcePushesEnforcementLevel field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetAuthorizedActorNames

func (b *BranchProtectionRule) GetAuthorizedActorNames() []string

GetAuthorizedActorNames returns the AuthorizedActorNames slice if it's non-nil, nil otherwise.

func (*BranchProtectionRule) GetAuthorizedActorsOnly

func (b *BranchProtectionRule) GetAuthorizedActorsOnly() bool

GetAuthorizedActorsOnly returns the AuthorizedActorsOnly field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetAuthorizedDismissalActorsOnly

func (b *BranchProtectionRule) GetAuthorizedDismissalActorsOnly() bool

GetAuthorizedDismissalActorsOnly returns the AuthorizedDismissalActorsOnly field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetCreatedAt

func (b *BranchProtectionRule) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetDismissStaleReviewsOnPush

func (b *BranchProtectionRule) GetDismissStaleReviewsOnPush() bool

GetDismissStaleReviewsOnPush returns the DismissStaleReviewsOnPush field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetID

func (b *BranchProtectionRule) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetIgnoreApprovalsFromContributors

func (b *BranchProtectionRule) GetIgnoreApprovalsFromContributors() bool

GetIgnoreApprovalsFromContributors returns the IgnoreApprovalsFromContributors field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetLinearHistoryRequirementEnforcementLevel

func (b *BranchProtectionRule) GetLinearHistoryRequirementEnforcementLevel() string

GetLinearHistoryRequirementEnforcementLevel returns the LinearHistoryRequirementEnforcementLevel field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetMergeQueueEnforcementLevel

func (b *BranchProtectionRule) GetMergeQueueEnforcementLevel() string

GetMergeQueueEnforcementLevel returns the MergeQueueEnforcementLevel field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetName

func (b *BranchProtectionRule) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetPullRequestReviewsEnforcementLevel

func (b *BranchProtectionRule) GetPullRequestReviewsEnforcementLevel() string

GetPullRequestReviewsEnforcementLevel returns the PullRequestReviewsEnforcementLevel field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetRepositoryID

func (b *BranchProtectionRule) GetRepositoryID() int64

GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetRequireCodeOwnerReview

func (b *BranchProtectionRule) GetRequireCodeOwnerReview() bool

GetRequireCodeOwnerReview returns the RequireCodeOwnerReview field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetRequireLastPushApproval

func (b *BranchProtectionRule) GetRequireLastPushApproval() bool

GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetRequiredApprovingReviewCount

func (b *BranchProtectionRule) GetRequiredApprovingReviewCount() int

GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetRequiredConversationResolutionLevel

func (b *BranchProtectionRule) GetRequiredConversationResolutionLevel() string

GetRequiredConversationResolutionLevel returns the RequiredConversationResolutionLevel field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetRequiredDeploymentsEnforcementLevel

func (b *BranchProtectionRule) GetRequiredDeploymentsEnforcementLevel() string

GetRequiredDeploymentsEnforcementLevel returns the RequiredDeploymentsEnforcementLevel field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetRequiredStatusChecks

func (b *BranchProtectionRule) GetRequiredStatusChecks() []string

GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise.

func (*BranchProtectionRule) GetRequiredStatusChecksEnforcementLevel

func (b *BranchProtectionRule) GetRequiredStatusChecksEnforcementLevel() string

GetRequiredStatusChecksEnforcementLevel returns the RequiredStatusChecksEnforcementLevel field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetSignatureRequirementEnforcementLevel

func (b *BranchProtectionRule) GetSignatureRequirementEnforcementLevel() string

GetSignatureRequirementEnforcementLevel returns the SignatureRequirementEnforcementLevel field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetStrictRequiredStatusChecksPolicy

func (b *BranchProtectionRule) GetStrictRequiredStatusChecksPolicy() bool

GetStrictRequiredStatusChecksPolicy returns the StrictRequiredStatusChecksPolicy field if it's non-nil, zero value otherwise.

func (*BranchProtectionRule) GetUpdatedAt

func (b *BranchProtectionRule) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type BranchProtectionRuleEvent

type BranchProtectionRuleEvent struct {
	Action       *string               `json:"action,omitempty"`
	Rule         *BranchProtectionRule `json:"rule,omitempty"`
	Changes      *ProtectionChanges    `json:"changes,omitempty"`
	Repo         *Repository           `json:"repository,omitempty"`
	Org          *Organization         `json:"organization,omitempty"`
	Sender       *User                 `json:"sender,omitempty"`
	Installation *Installation         `json:"installation,omitempty"`
}

BranchProtectionRuleEvent triggered when a check suite is "created", "edited", or "deleted". The Webhook event name is "branch_protection_rule".

GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule

func (*BranchProtectionRuleEvent) GetAction

func (b *BranchProtectionRuleEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*BranchProtectionRuleEvent) GetChanges

GetChanges returns the Changes field.

func (*BranchProtectionRuleEvent) GetInstallation

func (b *BranchProtectionRuleEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*BranchProtectionRuleEvent) GetOrg

GetOrg returns the Org field.

func (*BranchProtectionRuleEvent) GetRepo

func (b *BranchProtectionRuleEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*BranchProtectionRuleEvent) GetRule

GetRule returns the Rule field.

func (*BranchProtectionRuleEvent) GetSender

func (b *BranchProtectionRuleEvent) GetSender() *User

GetSender returns the Sender field.

type BranchRestrictions

type BranchRestrictions struct {
	// The list of user logins with push access.
	Users []*User `json:"users"`
	// The list of team slugs with push access.
	Teams []*Team `json:"teams"`
	// The list of app slugs with push access.
	Apps []*App `json:"apps"`
}

BranchRestrictions represents the restriction that only certain users or teams may push to a branch.

func (*BranchRestrictions) GetApps

func (b *BranchRestrictions) GetApps() []*App

GetApps returns the Apps slice if it's non-nil, nil otherwise.

func (*BranchRestrictions) GetTeams

func (b *BranchRestrictions) GetTeams() []*Team

GetTeams returns the Teams slice if it's non-nil, nil otherwise.

func (*BranchRestrictions) GetUsers

func (b *BranchRestrictions) GetUsers() []*User

GetUsers returns the Users slice if it's non-nil, nil otherwise.

type BranchRestrictionsRequest

type BranchRestrictionsRequest struct {
	// The list of user logins with push access. (Required; use []string{} instead of nil for empty list.)
	Users []string `json:"users"`
	// The list of team slugs with push access. (Required; use []string{} instead of nil for empty list.)
	Teams []string `json:"teams"`
	// The list of app slugs with push access.
	Apps []string `json:"apps"`
}

BranchRestrictionsRequest represents the request to create/edit the restriction that only certain users or teams may push to a branch. It is separate from BranchRestrictions above because the request structure is different from the response structure.

func (*BranchRestrictionsRequest) GetApps

func (b *BranchRestrictionsRequest) GetApps() []string

GetApps returns the Apps slice if it's non-nil, nil otherwise.

func (*BranchRestrictionsRequest) GetTeams

func (b *BranchRestrictionsRequest) GetTeams() []string

GetTeams returns the Teams slice if it's non-nil, nil otherwise.

func (*BranchRestrictionsRequest) GetUsers

func (b *BranchRestrictionsRequest) GetUsers() []string

GetUsers returns the Users slice if it's non-nil, nil otherwise.

type BranchRuleMetadata

type BranchRuleMetadata struct {
	RulesetSourceType RulesetSourceType `json:"ruleset_source_type"`
	RulesetSource     string            `json:"ruleset_source"`
	RulesetID         int64             `json:"ruleset_id"`
}

BranchRuleMetadata represents the metadata for a branch rule.

func (*BranchRuleMetadata) GetRulesetID

func (b *BranchRuleMetadata) GetRulesetID() int64

GetRulesetID returns the RulesetID field.

func (*BranchRuleMetadata) GetRulesetSource

func (b *BranchRuleMetadata) GetRulesetSource() string

GetRulesetSource returns the RulesetSource field.

func (*BranchRuleMetadata) GetRulesetSourceType

func (b *BranchRuleMetadata) GetRulesetSourceType() RulesetSourceType

GetRulesetSourceType returns the RulesetSourceType field.

type BranchRules

type BranchRules struct {
	// Branch or tag target rules.
	Creation                 []*BranchRuleMetadata
	Update                   []*UpdateBranchRule
	Deletion                 []*BranchRuleMetadata
	RequiredLinearHistory    []*BranchRuleMetadata
	MergeQueue               []*MergeQueueBranchRule
	RequiredDeployments      []*RequiredDeploymentsBranchRule
	RequiredSignatures       []*BranchRuleMetadata
	PullRequest              []*PullRequestBranchRule
	RequiredStatusChecks     []*RequiredStatusChecksBranchRule
	NonFastForward           []*BranchRuleMetadata
	CommitMessagePattern     []*PatternBranchRule
	CommitAuthorEmailPattern []*PatternBranchRule
	CommitterEmailPattern    []*PatternBranchRule
	BranchNamePattern        []*PatternBranchRule
	TagNamePattern           []*PatternBranchRule
	Workflows                []*WorkflowsBranchRule
	CodeScanning             []*CodeScanningBranchRule
	CopilotCodeReview        []*CopilotCodeReviewBranchRule

	// Push target rules.
	FileExtensionRestriction []*FileExtensionRestrictionBranchRule
	FilePathRestriction      []*FilePathRestrictionBranchRule
	MaxFilePathLength        []*MaxFilePathLengthBranchRule
	MaxFileSize              []*MaxFileSizeBranchRule
}

BranchRules represents the rules active for a GitHub repository branch. This type doesn't have JSON annotations as it uses custom marshaling.

func (*BranchRules) GetBranchNamePattern

func (b *BranchRules) GetBranchNamePattern() []*PatternBranchRule

GetBranchNamePattern returns the BranchNamePattern slice if it's non-nil, nil otherwise.

func (*BranchRules) GetCodeScanning

func (b *BranchRules) GetCodeScanning() []*CodeScanningBranchRule

GetCodeScanning returns the CodeScanning slice if it's non-nil, nil otherwise.

func (*BranchRules) GetCommitAuthorEmailPattern

func (b *BranchRules) GetCommitAuthorEmailPattern() []*PatternBranchRule

GetCommitAuthorEmailPattern returns the CommitAuthorEmailPattern slice if it's non-nil, nil otherwise.

func (*BranchRules) GetCommitMessagePattern

func (b *BranchRules) GetCommitMessagePattern() []*PatternBranchRule

GetCommitMessagePattern returns the CommitMessagePattern slice if it's non-nil, nil otherwise.

func (*BranchRules) GetCommitterEmailPattern

func (b *BranchRules) GetCommitterEmailPattern() []*PatternBranchRule

GetCommitterEmailPattern returns the CommitterEmailPattern slice if it's non-nil, nil otherwise.

func (*BranchRules) GetCopilotCodeReview

func (b *BranchRules) GetCopilotCodeReview() []*CopilotCodeReviewBranchRule

GetCopilotCodeReview returns the CopilotCodeReview slice if it's non-nil, nil otherwise.

func (*BranchRules) GetCreation

func (b *BranchRules) GetCreation() []*BranchRuleMetadata

GetCreation returns the Creation slice if it's non-nil, nil otherwise.

func (*BranchRules) GetDeletion

func (b *BranchRules) GetDeletion() []*BranchRuleMetadata

GetDeletion returns the Deletion slice if it's non-nil, nil otherwise.

func (*BranchRules) GetFileExtensionRestriction

func (b *BranchRules) GetFileExtensionRestriction() []*FileExtensionRestrictionBranchRule

GetFileExtensionRestriction returns the FileExtensionRestriction slice if it's non-nil, nil otherwise.

func (*BranchRules) GetFilePathRestriction

func (b *BranchRules) GetFilePathRestriction() []*FilePathRestrictionBranchRule

GetFilePathRestriction returns the FilePathRestriction slice if it's non-nil, nil otherwise.

func (*BranchRules) GetMaxFilePathLength

func (b *BranchRules) GetMaxFilePathLength() []*MaxFilePathLengthBranchRule

GetMaxFilePathLength returns the MaxFilePathLength slice if it's non-nil, nil otherwise.

func (*BranchRules) GetMaxFileSize

func (b *BranchRules) GetMaxFileSize() []*MaxFileSizeBranchRule

GetMaxFileSize returns the MaxFileSize slice if it's non-nil, nil otherwise.

func (*BranchRules) GetMergeQueue

func (b *BranchRules) GetMergeQueue() []*MergeQueueBranchRule

GetMergeQueue returns the MergeQueue slice if it's non-nil, nil otherwise.

func (*BranchRules) GetNonFastForward

func (b *BranchRules) GetNonFastForward() []*BranchRuleMetadata

GetNonFastForward returns the NonFastForward slice if it's non-nil, nil otherwise.

func (*BranchRules) GetPullRequest

func (b *BranchRules) GetPullRequest() []*PullRequestBranchRule

GetPullRequest returns the PullRequest slice if it's non-nil, nil otherwise.

func (*BranchRules) GetRequiredDeployments

func (b *BranchRules) GetRequiredDeployments() []*RequiredDeploymentsBranchRule

GetRequiredDeployments returns the RequiredDeployments slice if it's non-nil, nil otherwise.

func (*BranchRules) GetRequiredLinearHistory

func (b *BranchRules) GetRequiredLinearHistory() []*BranchRuleMetadata

GetRequiredLinearHistory returns the RequiredLinearHistory slice if it's non-nil, nil otherwise.

func (*BranchRules) GetRequiredSignatures

func (b *BranchRules) GetRequiredSignatures() []*BranchRuleMetadata

GetRequiredSignatures returns the RequiredSignatures slice if it's non-nil, nil otherwise.

func (*BranchRules) GetRequiredStatusChecks

func (b *BranchRules) GetRequiredStatusChecks() []*RequiredStatusChecksBranchRule

GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise.

func (*BranchRules) GetTagNamePattern

func (b *BranchRules) GetTagNamePattern() []*PatternBranchRule

GetTagNamePattern returns the TagNamePattern slice if it's non-nil, nil otherwise.

func (*BranchRules) GetUpdate

func (b *BranchRules) GetUpdate() []*UpdateBranchRule

GetUpdate returns the Update slice if it's non-nil, nil otherwise.

func (*BranchRules) GetWorkflows

func (b *BranchRules) GetWorkflows() []*WorkflowsBranchRule

GetWorkflows returns the Workflows slice if it's non-nil, nil otherwise.

func (*BranchRules) UnmarshalJSON

func (r *BranchRules) UnmarshalJSON(data []byte) error

UnmarshalJSON is a custom JSON unmarshaler for BranchRules.

type BypassActor

type BypassActor struct {
	ActorID    *int64           `json:"actor_id,omitempty"`
	ActorType  *BypassActorType `json:"actor_type,omitempty"`
	BypassMode *BypassMode      `json:"bypass_mode,omitempty"`
}

BypassActor represents the bypass actors from a ruleset.

func (*BypassActor) GetActorID

func (b *BypassActor) GetActorID() int64

GetActorID returns the ActorID field if it's non-nil, zero value otherwise.

func (*BypassActor) GetActorType

func (b *BypassActor) GetActorType() *BypassActorType

GetActorType returns the ActorType field.

func (*BypassActor) GetBypassMode

func (b *BypassActor) GetBypassMode() *BypassMode

GetBypassMode returns the BypassMode field.

type BypassActorType

type BypassActorType string

BypassActorType represents a GitHub ruleset bypass actor type.

const (
	BypassActorTypeIntegration       BypassActorType = "Integration"
	BypassActorTypeOrganizationAdmin BypassActorType = "OrganizationAdmin"
	BypassActorTypeRepositoryRole    BypassActorType = "RepositoryRole"
	BypassActorTypeTeam              BypassActorType = "Team"
	BypassActorTypeDeployKey         BypassActorType = "DeployKey"
)

This is the set of GitHub ruleset bypass actor types.

type BypassMode

type BypassMode string

BypassMode represents a GitHub ruleset bypass mode.

const (
	BypassModeAlways      BypassMode = "always"
	BypassModeExempt      BypassMode = "exempt"
	BypassModeNever       BypassMode = "never"
	BypassModePullRequest BypassMode = "pull_request"
)

This is the set of GitHub ruleset bypass modes.

type BypassPullRequestAllowances

type BypassPullRequestAllowances struct {
	// The list of users allowed to bypass pull request requirements.
	Users []*User `json:"users"`
	// The list of teams allowed to bypass pull request requirements.
	Teams []*Team `json:"teams"`
	// The list of apps allowed to bypass pull request requirements.
	Apps []*App `json:"apps"`
}

BypassPullRequestAllowances represents the people, teams, or apps who are allowed to bypass required pull requests.

func (*BypassPullRequestAllowances) GetApps

func (b *BypassPullRequestAllowances) GetApps() []*App

GetApps returns the Apps slice if it's non-nil, nil otherwise.

func (*BypassPullRequestAllowances) GetTeams

func (b *BypassPullRequestAllowances) GetTeams() []*Team

GetTeams returns the Teams slice if it's non-nil, nil otherwise.

func (*BypassPullRequestAllowances) GetUsers

func (b *BypassPullRequestAllowances) GetUsers() []*User

GetUsers returns the Users slice if it's non-nil, nil otherwise.

type BypassPullRequestAllowancesRequest

type BypassPullRequestAllowancesRequest struct {
	// The list of user logins allowed to bypass pull request requirements.
	Users []string `json:"users"`
	// The list of team slugs allowed to bypass pull request requirements.
	Teams []string `json:"teams"`
	// The list of app slugs allowed to bypass pull request requirements.
	Apps []string `json:"apps"`
}

BypassPullRequestAllowancesRequest represents the people, teams, or apps who are allowed to bypass required pull requests. It is separate from BypassPullRequestAllowances above because the request structure is different from the response structure.

func (*BypassPullRequestAllowancesRequest) GetApps

GetApps returns the Apps slice if it's non-nil, nil otherwise.

func (*BypassPullRequestAllowancesRequest) GetTeams

GetTeams returns the Teams slice if it's non-nil, nil otherwise.

func (*BypassPullRequestAllowancesRequest) GetUsers

GetUsers returns the Users slice if it's non-nil, nil otherwise.

type BypassReviewer

type BypassReviewer struct {
	ReviewerID              int64  `json:"reviewer_id"`
	ReviewerType            string `json:"reviewer_type"`
	SecurityConfigurationID *int64 `json:"security_configuration_id,omitempty"`
}

BypassReviewer represents the bypass reviewers for the delegated bypass of a code security configuration. SecurityConfigurationID is added by GitHub in responses.

func (*BypassReviewer) GetReviewerID

func (b *BypassReviewer) GetReviewerID() int64

GetReviewerID returns the ReviewerID field.

func (*BypassReviewer) GetReviewerType

func (b *BypassReviewer) GetReviewerType() string

GetReviewerType returns the ReviewerType field.

func (*BypassReviewer) GetSecurityConfigurationID

func (b *BypassReviewer) GetSecurityConfigurationID() int64

GetSecurityConfigurationID returns the SecurityConfigurationID field if it's non-nil, zero value otherwise.

type CheckRun

type CheckRun struct {
	ID           *int64          `json:"id,omitempty"`
	NodeID       *string         `json:"node_id,omitempty"`
	HeadSHA      *string         `json:"head_sha,omitempty"`
	ExternalID   *string         `json:"external_id,omitempty"`
	URL          *string         `json:"url,omitempty"`
	HTMLURL      *string         `json:"html_url,omitempty"`
	DetailsURL   *string         `json:"details_url,omitempty"`
	Status       *string         `json:"status,omitempty"`
	Conclusion   *string         `json:"conclusion,omitempty"`
	StartedAt    *Timestamp      `json:"started_at,omitempty"`
	CompletedAt  *Timestamp      `json:"completed_at,omitempty"`
	Output       *CheckRunOutput `json:"output,omitempty"`
	Name         *string         `json:"name,omitempty"`
	CheckSuite   *CheckSuite     `json:"check_suite,omitempty"`
	App          *App            `json:"app,omitempty"`
	PullRequests []*PullRequest  `json:"pull_requests,omitempty"`
}

CheckRun represents a GitHub check run on a repository associated with a GitHub app.

func (*CheckRun) GetApp

func (c *CheckRun) GetApp() *App

GetApp returns the App field.

func (*CheckRun) GetCheckSuite

func (c *CheckRun) GetCheckSuite() *CheckSuite

GetCheckSuite returns the CheckSuite field.

func (*CheckRun) GetCompletedAt

func (c *CheckRun) GetCompletedAt() Timestamp

GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.

func (*CheckRun) GetConclusion

func (c *CheckRun) GetConclusion() string

GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.

func (*CheckRun) GetDetailsURL

func (c *CheckRun) GetDetailsURL() string

GetDetailsURL returns the DetailsURL field if it's non-nil, zero value otherwise.

func (*CheckRun) GetExternalID

func (c *CheckRun) GetExternalID() string

GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise.

func (*CheckRun) GetHTMLURL

func (c *CheckRun) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*CheckRun) GetHeadSHA

func (c *CheckRun) GetHeadSHA() string

GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.

func (*CheckRun) GetID

func (c *CheckRun) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*CheckRun) GetName

func (c *CheckRun) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CheckRun) GetNodeID

func (c *CheckRun) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*CheckRun) GetOutput

func (c *CheckRun) GetOutput() *CheckRunOutput

GetOutput returns the Output field.

func (*CheckRun) GetPullRequests

func (c *CheckRun) GetPullRequests() []*PullRequest

GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise.

func (*CheckRun) GetStartedAt

func (c *CheckRun) GetStartedAt() Timestamp

GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.

func (*CheckRun) GetStatus

func (c *CheckRun) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*CheckRun) GetURL

func (c *CheckRun) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (CheckRun) String

func (c CheckRun) String() string

type CheckRunAction

type CheckRunAction struct {
	Label       string `json:"label"`       // The text to be displayed on a button in the web UI. The maximum size is 20 characters. (Required.)
	Description string `json:"description"` // A short explanation of what this action would do. The maximum size is 40 characters. (Required.)
	Identifier  string `json:"identifier"`  // A reference for the action on the integrator's system. The maximum size is 20 characters. (Required.)
}

CheckRunAction exposes further actions the integrator can perform, which a user may trigger.

func (*CheckRunAction) GetDescription

func (c *CheckRunAction) GetDescription() string

GetDescription returns the Description field.

func (*CheckRunAction) GetIdentifier

func (c *CheckRunAction) GetIdentifier() string

GetIdentifier returns the Identifier field.

func (*CheckRunAction) GetLabel

func (c *CheckRunAction) GetLabel() string

GetLabel returns the Label field.

type CheckRunAnnotation

type CheckRunAnnotation struct {
	Path            *string `json:"path,omitempty"`
	StartLine       *int    `json:"start_line,omitempty"`
	EndLine         *int    `json:"end_line,omitempty"`
	StartColumn     *int    `json:"start_column,omitempty"`
	EndColumn       *int    `json:"end_column,omitempty"`
	AnnotationLevel *string `json:"annotation_level,omitempty"`
	Message         *string `json:"message,omitempty"`
	Title           *string `json:"title,omitempty"`
	RawDetails      *string `json:"raw_details,omitempty"`
}

CheckRunAnnotation represents an annotation object for a CheckRun output.

func (*CheckRunAnnotation) GetAnnotationLevel

func (c *CheckRunAnnotation) GetAnnotationLevel() string

GetAnnotationLevel returns the AnnotationLevel field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetEndColumn

func (c *CheckRunAnnotation) GetEndColumn() int

GetEndColumn returns the EndColumn field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetEndLine

func (c *CheckRunAnnotation) GetEndLine() int

GetEndLine returns the EndLine field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetMessage

func (c *CheckRunAnnotation) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetPath

func (c *CheckRunAnnotation) GetPath() string

GetPath returns the Path field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetRawDetails

func (c *CheckRunAnnotation) GetRawDetails() string

GetRawDetails returns the RawDetails field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetStartColumn

func (c *CheckRunAnnotation) GetStartColumn() int

GetStartColumn returns the StartColumn field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetStartLine

func (c *CheckRunAnnotation) GetStartLine() int

GetStartLine returns the StartLine field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetTitle

func (c *CheckRunAnnotation) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

type CheckRunEvent

type CheckRunEvent struct {
	CheckRun *CheckRun `json:"check_run,omitempty"`
	// The action performed. Possible values are: "created", "completed", "rerequested" or "requested_action".
	Action *string `json:"action,omitempty"`

	// The following fields are only populated by Webhook events.
	Repo         *Repository   `json:"repository,omitempty"`
	Org          *Organization `json:"organization,omitempty"`
	Sender       *User         `json:"sender,omitempty"`
	Installation *Installation `json:"installation,omitempty"`

	// The action requested by the user. Populated when the Action is "requested_action".
	RequestedAction *RequestedAction `json:"requested_action,omitempty"` //
}

CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested". The Webhook event name is "check_run".

GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_run

func (*CheckRunEvent) GetAction

func (c *CheckRunEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*CheckRunEvent) GetCheckRun

func (c *CheckRunEvent) GetCheckRun() *CheckRun

GetCheckRun returns the CheckRun field.

func (*CheckRunEvent) GetInstallation

func (c *CheckRunEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*CheckRunEvent) GetOrg

func (c *CheckRunEvent) GetOrg() *Organization

GetOrg returns the Org field.

func (*CheckRunEvent) GetRepo

func (c *CheckRunEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*CheckRunEvent) GetRequestedAction

func (c *CheckRunEvent) GetRequestedAction() *RequestedAction

GetRequestedAction returns the RequestedAction field.

func (*CheckRunEvent) GetSender

func (c *CheckRunEvent) GetSender() *User

GetSender returns the Sender field.

type CheckRunImage

type CheckRunImage struct {
	Alt      *string `json:"alt,omitempty"`
	ImageURL *string `json:"image_url,omitempty"`
	Caption  *string `json:"caption,omitempty"`
}

CheckRunImage represents an image object for a CheckRun output.

func (*CheckRunImage) GetAlt

func (c *CheckRunImage) GetAlt() string

GetAlt returns the Alt field if it's non-nil, zero value otherwise.

func (*CheckRunImage) GetCaption

func (c *CheckRunImage) GetCaption() string

GetCaption returns the Caption field if it's non-nil, zero value otherwise.

func (*CheckRunImage) GetImageURL

func (c *CheckRunImage) GetImageURL() string

GetImageURL returns the ImageURL field if it's non-nil, zero value otherwise.

type CheckRunOutput

type CheckRunOutput struct {
	Title            *string               `json:"title,omitempty"`
	Summary          *string               `json:"summary,omitempty"`
	Text             *string               `json:"text,omitempty"`
	AnnotationsCount *int                  `json:"annotations_count,omitempty"`
	AnnotationsURL   *string               `json:"annotations_url,omitempty"`
	Annotations      []*CheckRunAnnotation `json:"annotations,omitempty"`
	Images           []*CheckRunImage      `json:"images,omitempty"`
}

CheckRunOutput represents the output of a CheckRun.

func (*CheckRunOutput) GetAnnotations

func (c *CheckRunOutput) GetAnnotations() []*CheckRunAnnotation

GetAnnotations returns the Annotations slice if it's non-nil, nil otherwise.

func (*CheckRunOutput) GetAnnotationsCount

func (c *CheckRunOutput) GetAnnotationsCount() int

GetAnnotationsCount returns the AnnotationsCount field if it's non-nil, zero value otherwise.

func (*CheckRunOutput) GetAnnotationsURL

func (c *CheckRunOutput) GetAnnotationsURL() string

GetAnnotationsURL returns the AnnotationsURL field if it's non-nil, zero value otherwise.

func (*CheckRunOutput) GetImages

func (c *CheckRunOutput) GetImages() []*CheckRunImage

GetImages returns the Images slice if it's non-nil, nil otherwise.

func (*CheckRunOutput) GetSummary

func (c *CheckRunOutput) GetSummary() string

GetSummary returns the Summary field if it's non-nil, zero value otherwise.

func (*CheckRunOutput) GetText

func (c *CheckRunOutput) GetText() string

GetText returns the Text field if it's non-nil, zero value otherwise.

func (*CheckRunOutput) GetTitle

func (c *CheckRunOutput) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

type CheckSuite

type CheckSuite struct {
	ID           *int64         `json:"id,omitempty"`
	NodeID       *string        `json:"node_id,omitempty"`
	HeadBranch   *string        `json:"head_branch,omitempty"`
	HeadSHA      *string        `json:"head_sha,omitempty"`
	URL          *string        `json:"url,omitempty"`
	BeforeSHA    *string        `json:"before,omitempty"`
	AfterSHA     *string        `json:"after,omitempty"`
	Status       *string        `json:"status,omitempty"`
	Conclusion   *string        `json:"conclusion,omitempty"`
	CreatedAt    *Timestamp     `json:"created_at,omitempty"`
	UpdatedAt    *Timestamp     `json:"updated_at,omitempty"`
	App          *App           `json:"app,omitempty"`
	Repository   *Repository    `json:"repository,omitempty"`
	PullRequests []*PullRequest `json:"pull_requests,omitempty"`

	// The following fields are only populated by Webhook events.
	HeadCommit           *Commit `json:"head_commit,omitempty"`
	LatestCheckRunsCount *int64  `json:"latest_check_runs_count,omitempty"`
	Rerequestable        *bool   `json:"rerequestable,omitempty"`
	RunsRerequestable    *bool   `json:"runs_rerequestable,omitempty"`
}

CheckSuite represents a suite of check runs.

func (*CheckSuite) GetAfterSHA

func (c *CheckSuite) GetAfterSHA() string

GetAfterSHA returns the AfterSHA field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetApp

func (c *CheckSuite) GetApp() *App

GetApp returns the App field.

func (*CheckSuite) GetBeforeSHA

func (c *CheckSuite) GetBeforeSHA() string

GetBeforeSHA returns the BeforeSHA field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetConclusion

func (c *CheckSuite) GetConclusion() string

GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetCreatedAt

func (c *CheckSuite) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetHeadBranch

func (c *CheckSuite) GetHeadBranch() string

GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetHeadCommit

func (c *CheckSuite) GetHeadCommit() *Commit

GetHeadCommit returns the HeadCommit field.

func (*CheckSuite) GetHeadSHA

func (c *CheckSuite) GetHeadSHA() string

GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetID

func (c *CheckSuite) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetLatestCheckRunsCount

func (c *CheckSuite) GetLatestCheckRunsCount() int64

GetLatestCheckRunsCount returns the LatestCheckRunsCount field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetNodeID

func (c *CheckSuite) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetPullRequests

func (c *CheckSuite) GetPullRequests() []*PullRequest

GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise.

func (*CheckSuite) GetRepository

func (c *CheckSuite) GetRepository() *Repository

GetRepository returns the Repository field.

func (*CheckSuite) GetRerequestable

func (c *CheckSuite) GetRerequestable() bool

GetRerequestable returns the Rerequestable field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetRunsRerequestable

func (c *CheckSuite) GetRunsRerequestable() bool

GetRunsRerequestable returns the RunsRerequestable field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetStatus

func (c *CheckSuite) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetURL

func (c *CheckSuite) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetUpdatedAt

func (c *CheckSuite) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (CheckSuite) String

func (c CheckSuite) String() string

type CheckSuiteEvent

type CheckSuiteEvent struct {
	CheckSuite *CheckSuite `json:"check_suite,omitempty"`
	// The action performed. Possible values are: "completed", "requested" or "rerequested".
	Action *string `json:"action,omitempty"`

	// The following fields are only populated by Webhook events.
	Repo         *Repository   `json:"repository,omitempty"`
	Org          *Organization `json:"organization,omitempty"`
	Sender       *User         `json:"sender,omitempty"`
	Installation *Installation `json:"installation,omitempty"`
}

CheckSuiteEvent is triggered when a check suite is "completed", "requested", or "rerequested". The Webhook event name is "check_suite".

GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_suite

func (*CheckSuiteEvent) GetAction

func (c *CheckSuiteEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*CheckSuiteEvent) GetCheckSuite

func (c *CheckSuiteEvent) GetCheckSuite() *CheckSuite

GetCheckSuite returns the CheckSuite field.

func (*CheckSuiteEvent) GetInstallation

func (c *CheckSuiteEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*CheckSuiteEvent) GetOrg

func (c *CheckSuiteEvent) GetOrg() *Organization

GetOrg returns the Org field.

func (*CheckSuiteEvent) GetRepo

func (c *CheckSuiteEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*CheckSuiteEvent) GetSender

func (c *CheckSuiteEvent) GetSender() *User

GetSender returns the Sender field.

type CheckSuitePreferenceOptions

type CheckSuitePreferenceOptions struct {
	AutoTriggerChecks []*AutoTriggerCheck `json:"auto_trigger_checks,omitempty"` // A slice of auto trigger checks that can be set for a check suite in a repository.
}

CheckSuitePreferenceOptions set options for check suite preferences for a repository.

func (*CheckSuitePreferenceOptions) GetAutoTriggerChecks

func (c *CheckSuitePreferenceOptions) GetAutoTriggerChecks() []*AutoTriggerCheck

GetAutoTriggerChecks returns the AutoTriggerChecks slice if it's non-nil, nil otherwise.

type CheckSuitePreferenceResults

type CheckSuitePreferenceResults struct {
	Preferences *PreferenceList `json:"preferences,omitempty"`
	Repository  *Repository     `json:"repository,omitempty"`
}

CheckSuitePreferenceResults represents the results of the preference set operation.

func (*CheckSuitePreferenceResults) GetPreferences

func (c *CheckSuitePreferenceResults) GetPreferences() *PreferenceList

GetPreferences returns the Preferences field.

func (*CheckSuitePreferenceResults) GetRepository

func (c *CheckSuitePreferenceResults) GetRepository() *Repository

GetRepository returns the Repository field.

type ChecksService

type ChecksService service

ChecksService provides access to the Checks API in the GitHub API.

GitHub API docs: https://docs.github.com/rest/checks?apiVersion=2022-11-28

func (*ChecksService) CreateCheckRun

func (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, opts CreateCheckRunOptions) (*CheckRun, *Response, error)

CreateCheckRun creates a check run for repository.

GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run

func (*ChecksService) CreateCheckSuite

func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string, opts CreateCheckSuiteOptions) (*CheckSuite, *Response, error)

CreateCheckSuite manually creates a check suite for a repository.

GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#create-a-check-suite

func (*ChecksService) GetCheckRun

func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*CheckRun, *Response, error)

GetCheckRun gets a check-run for a repository.

GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#get-a-check-run

func (*ChecksService) GetCheckSuite

func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*CheckSuite, *Response, error)

GetCheckSuite gets a single check suite.

GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#get-a-check-suite

func (*ChecksService) ListCheckRunAnnotations

func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64, opts *ListOptions) ([]*CheckRunAnnotation, *Response, error)

ListCheckRunAnnotations lists the annotations for a check run.

GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#list-check-run-annotations

func (*ChecksService) ListCheckRunAnnotationsIter

func (s *ChecksService) ListCheckRunAnnotationsIter(ctx context.Context, owner string, repo string, checkRunID int64, opts *ListOptions) iter.Seq2[*CheckRunAnnotation, error]

ListCheckRunAnnotationsIter returns an iterator that paginates through all results of ListCheckRunAnnotations.

func (*ChecksService) ListCheckRunsCheckSuite

func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error)

ListCheckRunsCheckSuite lists check runs for a check suite.

GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#list-check-runs-in-a-check-suite

func (*ChecksService) ListCheckRunsCheckSuiteIter

func (s *ChecksService) ListCheckRunsCheckSuiteIter(ctx context.Context, owner string, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) iter.Seq2[*CheckRun, error]

ListCheckRunsCheckSuiteIter returns an iterator that paginates through all results of ListCheckRunsCheckSuite.

func (*ChecksService) ListCheckRunsForRef

func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error)

ListCheckRunsForRef lists check runs for a specific ref. The ref can be a commit SHA, branch name `heads/<branch name>`, or tag name `tags/<tag name>`. For more information, see "Git References" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References.

GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#list-check-runs-for-a-git-reference

func (*ChecksService) ListCheckRunsForRefIter

func (s *ChecksService) ListCheckRunsForRefIter(ctx context.Context, owner string, repo string, ref string, opts *ListCheckRunsOptions) iter.Seq2[*CheckRun, error]

ListCheckRunsForRefIter returns an iterator that paginates through all results of ListCheckRunsForRef.

func (*ChecksService) ListCheckSuitesForRef

func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error)

ListCheckSuitesForRef lists check suite for a specific ref. The ref can be a commit SHA, branch name `heads/<branch name>`, or tag name `tags/<tag name>`. For more information, see "Git References" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References.

GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#list-check-suites-for-a-git-reference

func (*ChecksService) ListCheckSuitesForRefIter

func (s *ChecksService) ListCheckSuitesForRefIter(ctx context.Context, owner string, repo string, ref string, opts *ListCheckSuiteOptions) iter.Seq2[*CheckSuite, error]

ListCheckSuitesForRefIter returns an iterator that paginates through all results of ListCheckSuitesForRef.

func (*ChecksService) ReRequestCheckRun

func (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*Response, error)

ReRequestCheckRun triggers GitHub to rerequest an existing check run.

GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#rerequest-a-check-run

func (*ChecksService) ReRequestCheckSuite

func (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error)

ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository.

GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#rerequest-a-check-suite

func (*ChecksService) SetCheckSuitePreferences

func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, repo string, opts CheckSuitePreferenceOptions) (*CheckSuitePreferenceResults, *Response, error)

SetCheckSuitePreferences changes the default automatic flow when creating check suites.

GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#update-repository-preferences-for-check-suites

func (*ChecksService) UpdateCheckRun

func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, checkRunID int64, opts UpdateCheckRunOptions) (*CheckRun, *Response, error)

UpdateCheckRun updates a check run for a specific commit in a repository.

GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#update-a-check-run

type Classroom

type Classroom struct {
	ID           *int64        `json:"id,omitempty"`
	Name         *string       `json:"name,omitempty"`
	Archived     *bool         `json:"archived,omitempty"`
	Organization *Organization `json:"organization,omitempty"`
	URL          *string       `json:"url,omitempty"`
}

Classroom represents a GitHub Classroom.

func (*Classroom) GetArchived

func (c *Classroom) GetArchived() bool

GetArchived returns the Archived field if it's non-nil, zero value otherwise.

func (*Classroom) GetID

func (c *Classroom) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Classroom) GetName

func (c *Classroom) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Classroom) GetOrganization

func (c *Classroom) GetOrganization() *Organization

GetOrganization returns the Organization field.

func (*Classroom) GetURL

func (c *Classroom) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (Classroom) String

func (c Classroom) String() string

type ClassroomAssignment

type ClassroomAssignment struct {
	ID                          *int64      `json:"id,omitempty"`
	PublicRepo                  *bool       `json:"public_repo,omitempty"`
	Title                       *string     `json:"title,omitempty"`
	Type                        *string     `json:"type,omitempty"`
	InviteLink                  *string     `json:"invite_link,omitempty"`
	InvitationsEnabled          *bool       `json:"invitations_enabled,omitempty"`
	Slug                        *string     `json:"slug,omitempty"`
	StudentsAreRepoAdmins       *bool       `json:"students_are_repo_admins,omitempty"`
	FeedbackPullRequestsEnabled *bool       `json:"feedback_pull_requests_enabled,omitempty"`
	MaxTeams                    *int        `json:"max_teams,omitempty"`
	MaxMembers                  *int        `json:"max_members,omitempty"`
	Editor                      *string     `json:"editor,omitempty"`
	Accepted                    *int        `json:"accepted,omitempty"`
	Submitted                   *int        `json:"submitted,omitempty"`
	Passing                     *int        `json:"passing,omitempty"`
	Language                    *string     `json:"language,omitempty"`
	Deadline                    *Timestamp  `json:"deadline,omitempty"`
	StarterCodeRepository       *Repository `json:"starter_code_repository,omitempty"`
	Classroom                   *Classroom  `json:"classroom,omitempty"`
}

ClassroomAssignment represents a GitHub Classroom assignment.

func (*ClassroomAssignment) GetAccepted

func (c *ClassroomAssignment) GetAccepted() int

GetAccepted returns the Accepted field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetClassroom

func (c *ClassroomAssignment) GetClassroom() *Classroom

GetClassroom returns the Classroom field.

func (*ClassroomAssignment) GetDeadline

func (c *ClassroomAssignment) GetDeadline() Timestamp

GetDeadline returns the Deadline field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetEditor

func (c *ClassroomAssignment) GetEditor() string

GetEditor returns the Editor field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetFeedbackPullRequestsEnabled

func (c *ClassroomAssignment) GetFeedbackPullRequestsEnabled() bool

GetFeedbackPullRequestsEnabled returns the FeedbackPullRequestsEnabled field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetID

func (c *ClassroomAssignment) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetInvitationsEnabled

func (c *ClassroomAssignment) GetInvitationsEnabled() bool

GetInvitationsEnabled returns the InvitationsEnabled field if it's non-nil, zero value otherwise.

func (c *ClassroomAssignment) GetInviteLink() string

GetInviteLink returns the InviteLink field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetLanguage

func (c *ClassroomAssignment) GetLanguage() string

GetLanguage returns the Language field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetMaxMembers

func (c *ClassroomAssignment) GetMaxMembers() int

GetMaxMembers returns the MaxMembers field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetMaxTeams

func (c *ClassroomAssignment) GetMaxTeams() int

GetMaxTeams returns the MaxTeams field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetPassing

func (c *ClassroomAssignment) GetPassing() int

GetPassing returns the Passing field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetPublicRepo

func (c *ClassroomAssignment) GetPublicRepo() bool

GetPublicRepo returns the PublicRepo field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetSlug

func (c *ClassroomAssignment) GetSlug() string

GetSlug returns the Slug field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetStarterCodeRepository

func (c *ClassroomAssignment) GetStarterCodeRepository() *Repository

GetStarterCodeRepository returns the StarterCodeRepository field.

func (*ClassroomAssignment) GetStudentsAreRepoAdmins

func (c *ClassroomAssignment) GetStudentsAreRepoAdmins() bool

GetStudentsAreRepoAdmins returns the StudentsAreRepoAdmins field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetSubmitted

func (c *ClassroomAssignment) GetSubmitted() int

GetSubmitted returns the Submitted field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetTitle

func (c *ClassroomAssignment) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

func (*ClassroomAssignment) GetType

func (c *ClassroomAssignment) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (ClassroomAssignment) String

func (a ClassroomAssignment) String() string

type ClassroomService

type ClassroomService service

ClassroomService handles communication with the GitHub Classroom related methods of the GitHub API.

GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28

func (*ClassroomService) GetAssignment

func (s *ClassroomService) GetAssignment(ctx context.Context, assignmentID int64) (*ClassroomAssignment, *Response, error)

GetAssignment gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.

GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#get-an-assignment

func (*ClassroomService) GetAssignmentGrades

func (s *ClassroomService) GetAssignmentGrades(ctx context.Context, assignmentID int64) ([]*AssignmentGrade, *Response, error)

GetAssignmentGrades gets assignment grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.

GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#get-assignment-grades

func (*ClassroomService) GetClassroom

func (s *ClassroomService) GetClassroom(ctx context.Context, classroomID int64) (*Classroom, *Response, error)

GetClassroom gets a GitHub Classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom.

GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#get-a-classroom

func (*ClassroomService) ListAcceptedAssignments

func (s *ClassroomService) ListAcceptedAssignments(ctx context.Context, assignmentID int64, opts *ListOptions) ([]*AcceptedAssignment, *Response, error)

ListAcceptedAssignments lists accepted assignments for a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.

GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#list-accepted-assignments-for-an-assignment

func (*ClassroomService) ListAcceptedAssignmentsIter

func (s *ClassroomService) ListAcceptedAssignmentsIter(ctx context.Context, assignmentID int64, opts *ListOptions) iter.Seq2[*AcceptedAssignment, error]

ListAcceptedAssignmentsIter returns an iterator that paginates through all results of ListAcceptedAssignments.

func (*ClassroomService) ListClassroomAssignments

func (s *ClassroomService) ListClassroomAssignments(ctx context.Context, classroomID int64, opts *ListOptions) ([]*ClassroomAssignment, *Response, error)

ListClassroomAssignments lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom.

GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#list-assignments-for-a-classroom

func (*ClassroomService) ListClassroomAssignmentsIter

func (s *ClassroomService) ListClassroomAssignmentsIter(ctx context.Context, classroomID int64, opts *ListOptions) iter.Seq2[*ClassroomAssignment, error]

ListClassroomAssignmentsIter returns an iterator that paginates through all results of ListClassroomAssignments.

func (*ClassroomService) ListClassrooms

func (s *ClassroomService) ListClassrooms(ctx context.Context, opts *ListOptions) ([]*Classroom, *Response, error)

ListClassrooms lists GitHub Classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms.

GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#list-classrooms

func (*ClassroomService) ListClassroomsIter

func (s *ClassroomService) ListClassroomsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Classroom, error]

ListClassroomsIter returns an iterator that paginates through all results of ListClassrooms.

type ClassroomUser

type ClassroomUser struct {
	ID        *int64  `json:"id,omitempty"`
	Login     *string `json:"login,omitempty"`
	AvatarURL *string `json:"avatar_url,omitempty"`
	HTMLURL   *string `json:"html_url,omitempty"`
}

ClassroomUser represents a GitHub user simplified for Classroom.

func (*ClassroomUser) GetAvatarURL

func (c *ClassroomUser) GetAvatarURL() string

GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.

func (*ClassroomUser) GetHTMLURL

func (c *ClassroomUser) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*ClassroomUser) GetID

func (c *ClassroomUser) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*ClassroomUser) GetLogin

func (c *ClassroomUser) GetLogin() string

GetLogin returns the Login field if it's non-nil, zero value otherwise.

func (ClassroomUser) String

func (u ClassroomUser) String() string

type Client

type Client struct {

	// Services used for talking to different parts of the GitHub API.
	Actions            *ActionsService
	Activity           *ActivityService
	Admin              *AdminService
	Apps               *AppsService
	Authorizations     *AuthorizationsService
	Billing            *BillingService
	Checks             *ChecksService
	Classroom          *ClassroomService
	CodeScanning       *CodeScanningService
	CodesOfConduct     *CodesOfConductService
	Codespaces         *CodespacesService
	Copilot            *CopilotService
	Credentials        *CredentialsService
	Dependabot         *DependabotService
	DependencyGraph    *DependencyGraphService
	Emojis             *EmojisService
	Enterprise         *EnterpriseService
	Gists              *GistsService
	Git                *GitService
	Gitignores         *GitignoresService
	Interactions       *InteractionsService
	IssueImport        *IssueImportService
	Issues             *IssuesService
	Licenses           *LicensesService
	Markdown           *MarkdownService
	Marketplace        *MarketplaceService
	Meta               *MetaService
	Migrations         *MigrationService
	Organizations      *OrganizationsService
	PrivateRegistries  *PrivateRegistriesService
	Projects           *ProjectsService
	PullRequests       *PullRequestsService
	RateLimit          *RateLimitService
	Reactions          *ReactionsService
	Repositories       *RepositoriesService
	SCIM               *SCIMService
	Search             *SearchService
	SecretScanning     *SecretScanningService
	SecurityAdvisories *SecurityAdvisoriesService
	SubIssue           *SubIssueService
	Teams              *TeamsService
	Users              *UsersService
	// contains filtered or unexported fields
}

A Client manages communication with the GitHub API.

func NewClient

func NewClient(opts ...ClientOptionsFunc) (*Client, error)

NewClient returns a new GitHub API client configured with the provided options. The default configuration is suitable for making unauthenticated requests to the public GitHub API.

For GitHub Enterprise, use WithEnterpriseURLs to set the base and upload URLs.

To make authenticated requests, use WithAuthToken or WithHTTPClient to pass in a http.Client that performs authentication (e.g., using golang.org/x/oauth2).

For production usage it is recommended to provide a timeout using WithTimeout or by providing a custom http.Client with an appropriate timeout using WithHTTPClient.

func (*Client) APIMeta deprecated

func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error)

APIMeta returns information about GitHub.com.

Deprecated: Use MetaService.Get instead.

func (*Client) BareDo

func (c *Client) BareDo(req *http.Request) (*Response, error)

BareDo sends an API request and lets you handle the api response. If an error or API Error occurs, the error will contain more information. Otherwise, you are supposed to read and close the response's Body. If rate limit is exceeded and reset time is in the future, BareDo returns *RateLimitError immediately without making a network API call.

func (*Client) BaseURL

func (c *Client) BaseURL() string

BaseURL returns the base URL for API requests.

func (*Client) Client

func (c *Client) Client() *http.Client

Client returns the http.Client used by this GitHub client. This should only be used for requests to the GitHub API because request headers will contain an authorization token.

func (*Client) Clone

func (c *Client) Clone(opts ...ClientOptionsFunc) (*Client, error)

Clone returns a copy of the client with the same configuration and services. The returned client has its own http.Client but shares the client configuration such as transport and timeout. The returned client starts with the same rate limit information as the original client, but it is not updated when the original client's rate limit information is updated. The returned client is independent of the original client and can be modified without affecting the original client.

func (*Client) Do

func (c *Client) Do(req *http.Request, v any) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it. If v is nil, and no error happens, the response is returned as is. If rate limit is exceeded and reset time is in the future, Do returns *RateLimitError immediately without making a network API call.

func (*Client) GetCodeOfConduct deprecated

func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error)

GetCodeOfConduct returns an individual code of conduct.

Deprecated: Use CodesOfConductService.Get instead.

func (*Client) ListCodesOfConduct deprecated

func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error)

ListCodesOfConduct returns all codes of conduct.

Deprecated: Use CodesOfConductService.List instead.

func (*Client) ListEmojis deprecated

func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error)

ListEmojis returns the emojis available to use on GitHub.

Deprecated: Use EmojisService.List instead.

func (*Client) NewFormRequest

func (c *Client) NewFormRequest(ctx context.Context, urlStr string, body io.Reader, opts ...RequestOption) (*http.Request, error)

NewFormRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. Body is sent with Content-Type: application/x-www-form-urlencoded.

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body any, opts ...RequestOption) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

func (*Client) NewUploadRequest

func (c *Client) NewUploadRequest(ctx context.Context, urlStr string, reader io.Reader, size int64, mediaType string, opts ...RequestOption) (*http.Request, error)

NewUploadRequest creates an upload request. A relative URL can be provided in urlStr, in which case it is resolved relative to the UploadURL of the Client. Relative URLs should always be specified without a preceding slash.

func (*Client) Octocat deprecated

func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error)

Octocat returns an ASCII art octocat with the specified message in a speech bubble. If message is empty, a random zen phrase is used.

Deprecated: Use MetaService.Octocat instead.

func (*Client) RateLimits deprecated

func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error)

RateLimits returns the rate limits for the current client.

Deprecated: Use RateLimitService.Get instead.

func (*Client) UploadURL

func (c *Client) UploadURL() string

UploadURL returns the base URL for upload API requests.

func (*Client) UserAgent

func (c *Client) UserAgent() string

UserAgent returns the User-Agent header value for the client.

func (*Client) Zen deprecated

func (c *Client) Zen(ctx context.Context) (string, *Response, error)

Zen returns a random line from The Zen of GitHub.

Deprecated: Use MetaService.Zen instead.

type ClientOptionsFunc

type ClientOptionsFunc func(*clientOptions) error

ClientOptionsFunc is a functional option for providing configuration options to a Client.

func WithAuthToken

func WithAuthToken(token string) ClientOptionsFunc

WithAuthToken returns a ClientOptionsFunc that sets the authentication token for a Client. If not set, the client will make unauthenticated requests.

func WithDisableRateLimitCheck

func WithDisableRateLimitCheck() ClientOptionsFunc

WithDisableRateLimitCheck returns a ClientOptionsFunc that disables rate limit checking for a Client. If not set, the client will check for rate limits and track them.

func WithEnterpriseURLs

func WithEnterpriseURLs(baseURL, uploadURL string) ClientOptionsFunc

WithEnterpriseURLs returns a ClientOptionsFunc that sets the base and upload URLs for a Client.

func WithEnvProxy

func WithEnvProxy() ClientOptionsFunc

WithEnvProxy returns a ClientOptionsFunc that configures the Client to use the HTTP proxy settings from the environment variables (e.g., HTTP_PROXY, HTTPS_PROXY, NO_PROXY). If not set, the client will not use environment proxy settings.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOptionsFunc

WithHTTPClient returns a ClientOptionsFunc that sets the http.Client for a Client. If not set, a default http.Client will be used.

func WithMaxSecondaryRateLimitRetryAfterDuration

func WithMaxSecondaryRateLimitRetryAfterDuration(duration time.Duration) ClientOptionsFunc

WithMaxSecondaryRateLimitRetryAfterDuration returns a ClientOptionsFunc that configures the Client secondary rate limit max retry after duration.

func WithRateLimitRedirectionalEndpoints

func WithRateLimitRedirectionalEndpoints() ClientOptionsFunc

WithRateLimitRedirectionalEndpoints returns a ClientOptionsFunc that configures the Client to respect rate limit headers on endpoints that return 302 redirection to artifacts. If not set, the client will not respect rate limit headers on these endpoints.

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOptionsFunc

WithTimeout returns a ClientOptionsFunc that sets the timeout for a Client. This overrides the timeout set by WithHTTPClient. If not set and no HTTP client is provided, the default http.Client with no timeout will be used. It is recommended to provide a timeout for production environments.

func WithTransport

func WithTransport(transport http.RoundTripper) ClientOptionsFunc

WithTransport returns a ClientOptionsFunc that sets the http.RoundTripper for a Client. This overrides the transport set by WithHTTPClient. If not set and no HTTP client is provided, the default http.RoundTripper will be used.

func WithURLs

func WithURLs(baseURL, uploadURL *string) ClientOptionsFunc

WithURLs returns a ClientOptionsFunc that sets the base and upload URLs while only validating the URL format. Nil values will be ignored and default URLs will be used.

func WithUserAgent

func WithUserAgent(userAgent string) ClientOptionsFunc

WithUserAgent returns a ClientOptionsFunc that sets the User-Agent header for a Client. If not set, a default User-Agent will be used.

type ClusterArtifactDeployment

type ClusterArtifactDeployment struct {
	Name             string                  `json:"name"`
	Digest           string                  `json:"digest"`
	Version          *string                 `json:"version,omitempty"`
	Status           string                  `json:"status"`
	DeploymentName   string                  `json:"deployment_name"`
	Tags             map[string]string       `json:"tags,omitempty"`
	RuntimeRisks     []DeploymentRuntimeRisk `json:"runtime_risks,omitempty"`
	GithubRepository *string                 `json:"github_repository,omitempty"`
}

ClusterArtifactDeployment represents a deployment within a cluster record request.

func (*ClusterArtifactDeployment) GetDeploymentName

func (c *ClusterArtifactDeployment) GetDeploymentName() string

GetDeploymentName returns the DeploymentName field.

func (*ClusterArtifactDeployment) GetDigest

func (c *ClusterArtifactDeployment) GetDigest() string

GetDigest returns the Digest field.

func (*ClusterArtifactDeployment) GetGithubRepository

func (c *ClusterArtifactDeployment) GetGithubRepository() string

GetGithubRepository returns the GithubRepository field if it's non-nil, zero value otherwise.

func (*ClusterArtifactDeployment) GetName

func (c *ClusterArtifactDeployment) GetName() string

GetName returns the Name field.

func (*ClusterArtifactDeployment) GetRuntimeRisks

func (c *ClusterArtifactDeployment) GetRuntimeRisks() []DeploymentRuntimeRisk

GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise.

func (*ClusterArtifactDeployment) GetStatus

func (c *ClusterArtifactDeployment) GetStatus() string

GetStatus returns the Status field.

func (*ClusterArtifactDeployment) GetTags

func (c *ClusterArtifactDeployment) GetTags() map[string]string

GetTags returns the Tags map if it's non-nil, an empty map otherwise.

func (*ClusterArtifactDeployment) GetVersion

func (c *ClusterArtifactDeployment) GetVersion() string

GetVersion returns the Version field if it's non-nil, zero value otherwise.

type ClusterDeploymentRecordsRequest

type ClusterDeploymentRecordsRequest struct {
	LogicalEnvironment  string                       `json:"logical_environment"`
	PhysicalEnvironment *string                      `json:"physical_environment,omitempty"`
	Deployments         []*ClusterArtifactDeployment `json:"deployments"`
}

ClusterDeploymentRecordsRequest represents the request body for setting cluster deployment records.

func (*ClusterDeploymentRecordsRequest) GetDeployments

GetDeployments returns the Deployments slice if it's non-nil, nil otherwise.

func (*ClusterDeploymentRecordsRequest) GetLogicalEnvironment

func (c *ClusterDeploymentRecordsRequest) GetLogicalEnvironment() string

GetLogicalEnvironment returns the LogicalEnvironment field.

func (*ClusterDeploymentRecordsRequest) GetPhysicalEnvironment

func (c *ClusterDeploymentRecordsRequest) GetPhysicalEnvironment() string

GetPhysicalEnvironment returns the PhysicalEnvironment field if it's non-nil, zero value otherwise.

type ClusterSSHKey

type ClusterSSHKey struct {
	Key         *string `json:"key,omitempty"`
	Fingerprint *string `json:"fingerprint,omitempty"`
}

ClusterSSHKey represents the SSH keys configured for the instance.

func (*ClusterSSHKey) GetFingerprint

func (c *ClusterSSHKey) GetFingerprint() string

GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.

func (*ClusterSSHKey) GetKey

func (c *ClusterSSHKey) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

type ClusterStatus

type ClusterStatus struct {
	Status *string              `json:"status,omitempty"`
	Nodes  []*ClusterStatusNode `json:"nodes"`
}

ClusterStatus represents a response from the ClusterStatus and ReplicationStatus methods.

func (*ClusterStatus) GetNodes

func (c *ClusterStatus) GetNodes() []*ClusterStatusNode

GetNodes returns the Nodes slice if it's non-nil, nil otherwise.

func (*ClusterStatus) GetStatus

func (c *ClusterStatus) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

type ClusterStatusNode

type ClusterStatusNode struct {
	Hostname *string                         `json:"hostname,omitempty"`
	Status   *string                         `json:"status,omitempty"`
	Services []*ClusterStatusNodeServiceItem `json:"services"`
}

ClusterStatusNode represents the status of a cluster node.

func (*ClusterStatusNode) GetHostname

func (c *ClusterStatusNode) GetHostname() string

GetHostname returns the Hostname field if it's non-nil, zero value otherwise.

func (*ClusterStatusNode) GetServices

func (c *ClusterStatusNode) GetServices() []*ClusterStatusNodeServiceItem

GetServices returns the Services slice if it's non-nil, nil otherwise.

func (*ClusterStatusNode) GetStatus

func (c *ClusterStatusNode) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

type ClusterStatusNodeServiceItem

type ClusterStatusNodeServiceItem struct {
	Status  *string `json:"status,omitempty"`
	Name    *string `json:"name,omitempty"`
	Details *string `json:"details,omitempty"`
}

ClusterStatusNodeServiceItem represents the status of a service running on a cluster node.

func (*ClusterStatusNodeServiceItem) GetDetails

func (c *ClusterStatusNodeServiceItem) GetDetails() string

GetDetails returns the Details field if it's non-nil, zero value otherwise.

func (*ClusterStatusNodeServiceItem) GetName

func (c *ClusterStatusNodeServiceItem) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*ClusterStatusNodeServiceItem) GetStatus

func (c *ClusterStatusNodeServiceItem) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

type CodeOfConduct

type CodeOfConduct struct {
	Name *string `json:"name,omitempty"`
	Key  *string `json:"key,omitempty"`
	URL  *string `json:"url,omitempty"`
	Body *string `json:"body,omitempty"`
}

CodeOfConduct represents a code of conduct.

func (*CodeOfConduct) GetBody

func (c *CodeOfConduct) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*CodeOfConduct) GetKey

func (c *CodeOfConduct) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*CodeOfConduct) GetName

func (c *CodeOfConduct) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CodeOfConduct) GetURL

func (c *CodeOfConduct) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*CodeOfConduct) String

func (c *CodeOfConduct) String() string

type CodeQLDatabase

type CodeQLDatabase struct {
	ID          *int64     `json:"id,omitempty"`
	Name        *string    `json:"name,omitempty"`
	Language    *string    `json:"language,omitempty"`
	Uploader    *User      `json:"uploader,omitempty"`
	ContentType *string    `json:"content_type,omitempty"`
	Size        *int64     `json:"size,omitempty"`
	CreatedAt   *Timestamp `json:"created_at,omitempty"`
	UpdatedAt   *Timestamp `json:"updated_at,omitempty"`
	URL         *string    `json:"url,omitempty"`
}

CodeQLDatabase represents a metadata about the CodeQL database.

GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28

func (*CodeQLDatabase) GetContentType

func (c *CodeQLDatabase) GetContentType() string

GetContentType returns the ContentType field if it's non-nil, zero value otherwise.

func (*CodeQLDatabase) GetCreatedAt

func (c *CodeQLDatabase) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*CodeQLDatabase) GetID

func (c *CodeQLDatabase) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*CodeQLDatabase) GetLanguage

func (c *CodeQLDatabase) GetLanguage() string

GetLanguage returns the Language field if it's non-nil, zero value otherwise.

func (*CodeQLDatabase) GetName

func (c *CodeQLDatabase) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CodeQLDatabase) GetSize

func (c *CodeQLDatabase) GetSize() int64

GetSize returns the Size field if it's non-nil, zero value otherwise.

func (*CodeQLDatabase) GetURL

func (c *CodeQLDatabase) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*CodeQLDatabase) GetUpdatedAt

func (c *CodeQLDatabase) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (*CodeQLDatabase) GetUploader

func (c *CodeQLDatabase) GetUploader() *User

GetUploader returns the Uploader field.

type CodeResult

type CodeResult struct {
	Name        *string      `json:"name,omitempty"`
	Path        *string      `json:"path,omitempty"`
	SHA         *string      `json:"sha,omitempty"`
	HTMLURL     *string      `json:"html_url,omitempty"`
	Repository  *Repository  `json:"repository,omitempty"`
	TextMatches []*TextMatch `json:"text_matches,omitempty"`
}

CodeResult represents a single search result.

func (*CodeResult) GetHTMLURL

func (c *CodeResult) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*CodeResult) GetName

func (c *CodeResult) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CodeResult) GetPath

func (c *CodeResult) GetPath() string

GetPath returns the Path field if it's non-nil, zero value otherwise.

func (*CodeResult) GetRepository

func (c *CodeResult) GetRepository() *Repository

GetRepository returns the Repository field.

func (*CodeResult) GetSHA

func (c *CodeResult) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*CodeResult) GetTextMatches

func (c *CodeResult) GetTextMatches() []*TextMatch

GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise.

func (CodeResult) String

func (c CodeResult) String() string

type CodeScanningAlertEvent

type CodeScanningAlertEvent struct {
	Action *string `json:"action,omitempty"`
	Alert  *Alert  `json:"alert,omitempty"`
	Ref    *string `json:"ref,omitempty"`
	// CommitOID is the commit SHA of the code scanning alert
	CommitOID *string       `json:"commit_oid,omitempty"`
	Repo      *Repository   `json:"repository,omitempty"`
	Org       *Organization `json:"organization,omitempty"`
	Sender    *User         `json:"sender,omitempty"`

	Installation *Installation `json:"installation,omitempty"`
}

CodeScanningAlertEvent is triggered when a code scanning finds a potential vulnerability or error in your code.

GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#code_scanning_alert

func (*CodeScanningAlertEvent) GetAction

func (c *CodeScanningAlertEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*CodeScanningAlertEvent) GetAlert

func (c *CodeScanningAlertEvent) GetAlert() *Alert

GetAlert returns the Alert field.

func (*CodeScanningAlertEvent) GetCommitOID

func (c *CodeScanningAlertEvent) GetCommitOID() string

GetCommitOID returns the CommitOID field if it's non-nil, zero value otherwise.

func (*CodeScanningAlertEvent) GetInstallation

func (c *CodeScanningAlertEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*CodeScanningAlertEvent) GetOrg

func (c *CodeScanningAlertEvent) GetOrg() *Organization

GetOrg returns the Org field.

func (*CodeScanningAlertEvent) GetRef

func (c *CodeScanningAlertEvent) GetRef() string

GetRef returns the Ref field if it's non-nil, zero value otherwise.

func (*CodeScanningAlertEvent) GetRepo

func (c *CodeScanningAlertEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*CodeScanningAlertEvent) GetSender

func (c *CodeScanningAlertEvent) GetSender() *User

GetSender returns the Sender field.

type CodeScanningAlertState

type CodeScanningAlertState struct {
	// State sets the state of the code scanning alert and is a required field.
	// You must also provide DismissedReason when you set the state to "dismissed".
	// State can be one of: "open", "dismissed".
	State string `json:"state"`
	// DismissedReason represents the reason for dismissing or closing the alert.
	// It is required when the state is "dismissed".
	// It can be one of: "false positive", "won't fix", "used in tests".
	DismissedReason *string `json:"dismissed_reason,omitempty"`
	// DismissedComment is associated with the dismissal of the alert.
	DismissedComment *string `json:"dismissed_comment,omitempty"`
}

CodeScanningAlertState specifies the state of a code scanning alert.

GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28

func (*CodeScanningAlertState) GetDismissedComment

func (c *CodeScanningAlertState) GetDismissedComment() string

GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise.

func (*CodeScanningAlertState) GetDismissedReason

func (c *CodeScanningAlertState) GetDismissedReason() string

GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise.

func (*CodeScanningAlertState) GetState

func (c *CodeScanningAlertState) GetState() string

GetState returns the State field.

type CodeScanningAlertsThreshold

type CodeScanningAlertsThreshold string

CodeScanningAlertsThreshold models a GitHub code scanning alerts threshold.

const (
	CodeScanningAlertsThresholdNone              CodeScanningAlertsThreshold = "none"
	CodeScanningAlertsThresholdErrors            CodeScanningAlertsThreshold = "errors"
	CodeScanningAlertsThresholdErrorsAndWarnings CodeScanningAlertsThreshold = "errors_and_warnings"
	CodeScanningAlertsThresholdAll               CodeScanningAlertsThreshold = "all"
)

This is the set of GitHub code scanning alerts thresholds.

type CodeScanningBranchRule

type CodeScanningBranchRule struct {
	BranchRuleMetadata
	Parameters CodeScanningRuleParameters `json:"parameters"`
}

CodeScanningBranchRule represents a code scanning branch rule.

func (*CodeScanningBranchRule) GetParameters

GetParameters returns the Parameters field.

type CodeScanningDefaultSetupOptions

type CodeScanningDefaultSetupOptions struct {
	RunnerType  string  `json:"runner_type"`
	RunnerLabel *string `json:"runner_label,omitempty"`
}

CodeScanningDefaultSetupOptions represents the feature options for the code scanning default options.

func (*CodeScanningDefaultSetupOptions) GetRunnerLabel

func (c *CodeScanningDefaultSetupOptions) GetRunnerLabel() string

GetRunnerLabel returns the RunnerLabel field if it's non-nil, zero value otherwise.

func (*CodeScanningDefaultSetupOptions) GetRunnerType

func (c *CodeScanningDefaultSetupOptions) GetRunnerType() string

GetRunnerType returns the RunnerType field.

type CodeScanningOptions

type CodeScanningOptions struct {
	AllowAdvanced *bool `json:"allow_advanced,omitempty"`
}

CodeScanningOptions represents the options for the Security Configuration code scanning feature.

func (*CodeScanningOptions) GetAllowAdvanced

func (c *CodeScanningOptions) GetAllowAdvanced() bool

GetAllowAdvanced returns the AllowAdvanced field if it's non-nil, zero value otherwise.

type CodeScanningRuleParameters

type CodeScanningRuleParameters struct {
	CodeScanningTools []*RuleCodeScanningTool `json:"code_scanning_tools"`
}

CodeScanningRuleParameters represents the code scanning rule parameters.

func (*CodeScanningRuleParameters) GetCodeScanningTools

func (c *CodeScanningRuleParameters) GetCodeScanningTools() []*RuleCodeScanningTool

GetCodeScanningTools returns the CodeScanningTools slice if it's non-nil, nil otherwise.

type CodeScanningSecurityAlertsThreshold

type CodeScanningSecurityAlertsThreshold string

CodeScanningSecurityAlertsThreshold models a GitHub code scanning security alerts threshold.

const (
	CodeScanningSecurityAlertsThresholdNone           CodeScanningSecurityAlertsThreshold = "none"
	CodeScanningSecurityAlertsThresholdCritical       CodeScanningSecurityAlertsThreshold = "critical"
	CodeScanningSecurityAlertsThresholdHighOrHigher   CodeScanningSecurityAlertsThreshold = "high_or_higher"
	CodeScanningSecurityAlertsThresholdMediumOrHigher CodeScanningSecurityAlertsThreshold = "medium_or_higher"
	CodeScanningSecurityAlertsThresholdAll            CodeScanningSecurityAlertsThreshold = "all"
)

This is the set of GitHub code scanning security alerts thresholds.

type CodeScanningService

type CodeScanningService service

CodeScanningService handles communication with the code scanning related methods of the GitHub API.

GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28

func (*CodeScanningService) DeleteAnalysis

func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo string, id int64) (*DeleteAnalysis, *Response, error)

DeleteAnalysis deletes a single code scanning analysis from a repository.

You must use an access token with the repo scope to use this endpoint. GitHub Apps must have the security_events read permission to use this endpoint.

The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#delete-a-code-scanning-analysis-from-a-repository

func (*CodeScanningService) GetAlert

func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error)

GetAlert gets a single code scanning alert for a repository.

You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events read permission to use this endpoint.

The security alert_id is the number at the end of the security alert's URL.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-code-scanning-alert

func (*CodeScanningService) GetAnalysis

func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error)

GetAnalysis gets a single code scanning analysis for a repository.

You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events read permission to use this endpoint.

The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-code-scanning-analysis-for-a-repository

func (*CodeScanningService) GetCodeQLDatabase

func (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo, language string) (*CodeQLDatabase, *Response, error)

GetCodeQLDatabase gets a CodeQL database for a language in a repository.

You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the contents read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-codeql-database-for-a-repository

func (*CodeScanningService) GetDefaultSetupConfiguration

func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error)

GetDefaultSetupConfiguration gets a code scanning default setup configuration.

You must use an access token with the repo scope to use this endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-code-scanning-default-setup-configuration

func (*CodeScanningService) GetSARIF

func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID string) (*SARIFUpload, *Response, error)

GetSARIF gets information about a SARIF upload.

You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-information-about-a-sarif-upload

func (*CodeScanningService) ListAlertInstances

func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, repo string, id int64, opts *AlertInstancesListOptions) ([]*MostRecentInstance, *Response, error)

ListAlertInstances lists instances of a code scanning alert.

You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-instances-of-a-code-scanning-alert

func (*CodeScanningService) ListAlertInstancesIter

func (s *CodeScanningService) ListAlertInstancesIter(ctx context.Context, owner string, repo string, id int64, opts *AlertInstancesListOptions) iter.Seq2[*MostRecentInstance, error]

ListAlertInstancesIter returns an iterator that paginates through all results of ListAlertInstances.

func (*CodeScanningService) ListAlertsForOrg

func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *AlertListOptions) ([]*Alert, *Response, error)

ListAlertsForOrg lists code scanning alerts for an org.

You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-code-scanning-alerts-for-an-organization

func (*CodeScanningService) ListAlertsForOrgIter

func (s *CodeScanningService) ListAlertsForOrgIter(ctx context.Context, org string, opts *AlertListOptions) iter.Seq2[*Alert, error]

ListAlertsForOrgIter returns an iterator that paginates through all results of ListAlertsForOrg.

func (*CodeScanningService) ListAlertsForRepo

func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error)

ListAlertsForRepo lists code scanning alerts for a repository.

Lists all open code scanning alerts for the default branch (usually master) and protected branches in a repository. You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-code-scanning-alerts-for-a-repository

func (*CodeScanningService) ListAlertsForRepoIter

func (s *CodeScanningService) ListAlertsForRepoIter(ctx context.Context, owner string, repo string, opts *AlertListOptions) iter.Seq2[*Alert, error]

ListAlertsForRepoIter returns an iterator that paginates through all results of ListAlertsForRepo.

func (*CodeScanningService) ListAnalysesForRepo

func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error)

ListAnalysesForRepo lists code scanning analyses for a repository.

Lists the details of all code scanning analyses for a repository, starting with the most recent. You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-code-scanning-analyses-for-a-repository

func (*CodeScanningService) ListAnalysesForRepoIter

func (s *CodeScanningService) ListAnalysesForRepoIter(ctx context.Context, owner string, repo string, opts *AnalysesListOptions) iter.Seq2[*ScanningAnalysis, error]

ListAnalysesForRepoIter returns an iterator that paginates through all results of ListAnalysesForRepo.

func (*CodeScanningService) ListCodeQLDatabases

func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, repo string) ([]*CodeQLDatabase, *Response, error)

ListCodeQLDatabases lists the CodeQL databases that are available in a repository.

You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the contents read permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-codeql-databases-for-a-repository

func (*CodeScanningService) UpdateAlert

func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *CodeScanningAlertState) (*Alert, *Response, error)

UpdateAlert updates the state of a single code scanning alert for a repository.

You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events read permission to use this endpoint.

The security alert_id is the number at the end of the security alert's URL.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-alert

func (*CodeScanningService) UpdateDefaultSetupConfiguration

UpdateDefaultSetupConfiguration updates a code scanning default setup configuration.

You must use an access token with the repo scope to use this endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write permission to use this endpoint.

This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub returns to signify that it has now scheduled the update of the pull request branch in a background task.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-default-setup-configuration

func (*CodeScanningService) UploadSarif

func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error)

UploadSarif uploads the result of code scanning job to GitHub.

For the parameter sarif, you must first compress your SARIF file using gzip and then translate the contents of the file into a Base64 encoding string. You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events write permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#upload-an-analysis-as-sarif-data

type CodeSearchResult

type CodeSearchResult struct {
	Total             *int          `json:"total_count,omitempty"`
	IncompleteResults *bool         `json:"incomplete_results,omitempty"`
	CodeResults       []*CodeResult `json:"items,omitempty"`
}

CodeSearchResult represents the result of a code search.

func (*CodeSearchResult) GetCodeResults

func (c *CodeSearchResult) GetCodeResults() []*CodeResult

GetCodeResults returns the CodeResults slice if it's non-nil, nil otherwise.

func (*CodeSearchResult) GetIncompleteResults

func (c *CodeSearchResult) GetIncompleteResults() bool

GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.

func (*CodeSearchResult) GetTotal

func (c *CodeSearchResult) GetTotal() int

GetTotal returns the Total field if it's non-nil, zero value otherwise.

type CodeSecurity

type CodeSecurity struct {
	Status *string `json:"status,omitempty"`
}

CodeSecurity represents the state of code security on a repository.

GitHub API docs: https://docs.github.com/en/code-security/getting-started/github-security-features#available-with-github-code-security

func (*CodeSecurity) GetStatus

func (c *CodeSecurity) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (CodeSecurity) String

func (c CodeSecurity) String() string

type CodeSecurityConfiguration

type CodeSecurityConfiguration struct {
	ID                                     *int64                                  `json:"id,omitempty"`
	TargetType                             *string                                 `json:"target_type,omitempty"`
	Name                                   string                                  `json:"name"`
	Description                            string                                  `json:"description"`
	AdvancedSecurity                       *string                                 `json:"advanced_security,omitempty"`
	DependencyGraph                        *string                                 `json:"dependency_graph,omitempty"`
	DependencyGraphAutosubmitAction        *string                                 `json:"dependency_graph_autosubmit_action,omitempty"`
	DependencyGraphAutosubmitActionOptions *DependencyGraphAutosubmitActionOptions `json:"dependency_graph_autosubmit_action_options,omitempty"`
	DependabotAlerts                       *string                                 `json:"dependabot_alerts,omitempty"`
	DependabotDelegatedAlertDismissal      *string                                 `json:"dependabot_delegated_alert_dismissal,omitempty"`
	DependabotSecurityUpdates              *string                                 `json:"dependabot_security_updates,omitempty"`
	CodeScanningDefaultSetup               *string                                 `json:"code_scanning_default_setup,omitempty"`
	CodeScanningDefaultSetupOptions        *CodeScanningDefaultSetupOptions        `json:"code_scanning_default_setup_options,omitempty"`
	CodeScanningDelegatedAlertDismissal    *string                                 `json:"code_scanning_delegated_alert_dismissal,omitempty"`
	CodeScanningOptions                    *CodeScanningOptions                    `json:"code_scanning_options,omitempty"`
	CodeSecurity                           *string                                 `json:"code_security,omitempty"`
	SecretScanning                         *string                                 `json:"secret_scanning,omitempty"`
	SecretScanningPushProtection           *string                                 `json:"secret_scanning_push_protection,omitempty"`
	SecretScanningDelegatedBypass          *string                                 `json:"secret_scanning_delegated_bypass,omitempty"`
	SecretScanningDelegatedBypassOptions   *SecretScanningDelegatedBypassOptions   `json:"secret_scanning_delegated_bypass_options,omitempty"`
	SecretScanningValidityChecks           *string                                 `json:"secret_scanning_validity_checks,omitempty"`
	SecretScanningNonProviderPatterns      *string                                 `json:"secret_scanning_non_provider_patterns,omitempty"`
	SecretScanningGenericSecrets           *string                                 `json:"secret_scanning_generic_secrets,omitempty"`
	SecretScanningDelegatedAlertDismissal  *string                                 `json:"secret_scanning_delegated_alert_dismissal,omitempty"`
	SecretScanningExtendedMetadata         *string                                 `json:"secret_scanning_extended_metadata,omitempty"`
	SecretProtection                       *string                                 `json:"secret_protection,omitempty"`
	PrivateVulnerabilityReporting          *string                                 `json:"private_vulnerability_reporting,omitempty"`
	Enforcement                            *string                                 `json:"enforcement,omitempty"`
	URL                                    *string                                 `json:"url,omitempty"`
	HTMLURL                                *string                                 `json:"html_url,omitempty"`
	CreatedAt                              *Timestamp                              `json:"created_at,omitempty"`
	UpdatedAt                              *Timestamp                              `json:"updated_at,omitempty"`
}

CodeSecurityConfiguration represents a code security configuration.

func (*CodeSecurityConfiguration) GetAdvancedSecurity

func (c *CodeSecurityConfiguration) GetAdvancedSecurity() string

GetAdvancedSecurity returns the AdvancedSecurity field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetCodeScanningDefaultSetup

func (c *CodeSecurityConfiguration) GetCodeScanningDefaultSetup() string

GetCodeScanningDefaultSetup returns the CodeScanningDefaultSetup field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetCodeScanningDefaultSetupOptions

func (c *CodeSecurityConfiguration) GetCodeScanningDefaultSetupOptions() *CodeScanningDefaultSetupOptions

GetCodeScanningDefaultSetupOptions returns the CodeScanningDefaultSetupOptions field.

func (*CodeSecurityConfiguration) GetCodeScanningDelegatedAlertDismissal

func (c *CodeSecurityConfiguration) GetCodeScanningDelegatedAlertDismissal() string

GetCodeScanningDelegatedAlertDismissal returns the CodeScanningDelegatedAlertDismissal field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetCodeScanningOptions

func (c *CodeSecurityConfiguration) GetCodeScanningOptions() *CodeScanningOptions

GetCodeScanningOptions returns the CodeScanningOptions field.

func (*CodeSecurityConfiguration) GetCodeSecurity

func (c *CodeSecurityConfiguration) GetCodeSecurity() string

GetCodeSecurity returns the CodeSecurity field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetCreatedAt

func (c *CodeSecurityConfiguration) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetDependabotAlerts

func (c *CodeSecurityConfiguration) GetDependabotAlerts() string

GetDependabotAlerts returns the DependabotAlerts field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetDependabotDelegatedAlertDismissal

func (c *CodeSecurityConfiguration) GetDependabotDelegatedAlertDismissal() string

GetDependabotDelegatedAlertDismissal returns the DependabotDelegatedAlertDismissal field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetDependabotSecurityUpdates

func (c *CodeSecurityConfiguration) GetDependabotSecurityUpdates() string

GetDependabotSecurityUpdates returns the DependabotSecurityUpdates field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetDependencyGraph

func (c *CodeSecurityConfiguration) GetDependencyGraph() string

GetDependencyGraph returns the DependencyGraph field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetDependencyGraphAutosubmitAction

func (c *CodeSecurityConfiguration) GetDependencyGraphAutosubmitAction() string

GetDependencyGraphAutosubmitAction returns the DependencyGraphAutosubmitAction field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetDependencyGraphAutosubmitActionOptions

func (c *CodeSecurityConfiguration) GetDependencyGraphAutosubmitActionOptions() *DependencyGraphAutosubmitActionOptions

GetDependencyGraphAutosubmitActionOptions returns the DependencyGraphAutosubmitActionOptions field.

func (*CodeSecurityConfiguration) GetDescription

func (c *CodeSecurityConfiguration) GetDescription() string

GetDescription returns the Description field.

func (*CodeSecurityConfiguration) GetEnforcement

func (c *CodeSecurityConfiguration) GetEnforcement() string

GetEnforcement returns the Enforcement field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetHTMLURL

func (c *CodeSecurityConfiguration) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetID

func (c *CodeSecurityConfiguration) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetName

func (c *CodeSecurityConfiguration) GetName() string

GetName returns the Name field.

func (*CodeSecurityConfiguration) GetPrivateVulnerabilityReporting

func (c *CodeSecurityConfiguration) GetPrivateVulnerabilityReporting() string

GetPrivateVulnerabilityReporting returns the PrivateVulnerabilityReporting field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetSecretProtection

func (c *CodeSecurityConfiguration) GetSecretProtection() string

GetSecretProtection returns the SecretProtection field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetSecretScanning

func (c *CodeSecurityConfiguration) GetSecretScanning() string

GetSecretScanning returns the SecretScanning field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetSecretScanningDelegatedAlertDismissal

func (c *CodeSecurityConfiguration) GetSecretScanningDelegatedAlertDismissal() string

GetSecretScanningDelegatedAlertDismissal returns the SecretScanningDelegatedAlertDismissal field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetSecretScanningDelegatedBypass

func (c *CodeSecurityConfiguration) GetSecretScanningDelegatedBypass() string

GetSecretScanningDelegatedBypass returns the SecretScanningDelegatedBypass field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetSecretScanningDelegatedBypassOptions

func (c *CodeSecurityConfiguration) GetSecretScanningDelegatedBypassOptions() *SecretScanningDelegatedBypassOptions

GetSecretScanningDelegatedBypassOptions returns the SecretScanningDelegatedBypassOptions field.

func (*CodeSecurityConfiguration) GetSecretScanningExtendedMetadata

func (c *CodeSecurityConfiguration) GetSecretScanningExtendedMetadata() string

GetSecretScanningExtendedMetadata returns the SecretScanningExtendedMetadata field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetSecretScanningGenericSecrets

func (c *CodeSecurityConfiguration) GetSecretScanningGenericSecrets() string

GetSecretScanningGenericSecrets returns the SecretScanningGenericSecrets field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetSecretScanningNonProviderPatterns

func (c *CodeSecurityConfiguration) GetSecretScanningNonProviderPatterns() string

GetSecretScanningNonProviderPatterns returns the SecretScanningNonProviderPatterns field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetSecretScanningPushProtection

func (c *CodeSecurityConfiguration) GetSecretScanningPushProtection() string

GetSecretScanningPushProtection returns the SecretScanningPushProtection field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetSecretScanningValidityChecks

func (c *CodeSecurityConfiguration) GetSecretScanningValidityChecks() string

GetSecretScanningValidityChecks returns the SecretScanningValidityChecks field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetTargetType

func (c *CodeSecurityConfiguration) GetTargetType() string

GetTargetType returns the TargetType field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetURL

func (c *CodeSecurityConfiguration) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*CodeSecurityConfiguration) GetUpdatedAt

func (c *CodeSecurityConfiguration) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type CodeSecurityConfigurationWithDefaultForNewRepos

type CodeSecurityConfigurationWithDefaultForNewRepos struct {
	Configuration      *CodeSecurityConfiguration `json:"configuration"`
	DefaultForNewRepos *string                    `json:"default_for_new_repos,omitempty"`
}

CodeSecurityConfigurationWithDefaultForNewRepos represents a code security configuration with default for new repos param.

func (*CodeSecurityConfigurationWithDefaultForNewRepos) GetConfiguration

GetConfiguration returns the Configuration field.

func (*CodeSecurityConfigurationWithDefaultForNewRepos) GetDefaultForNewRepos

func (c *CodeSecurityConfigurationWithDefaultForNewRepos) GetDefaultForNewRepos() string

GetDefaultForNewRepos returns the DefaultForNewRepos field if it's non-nil, zero value otherwise.

type CodeownersError

type CodeownersError struct {
	Line       int     `json:"line"`
	Column     int     `json:"column"`
	Kind       string  `json:"kind"`
	Source     string  `json:"source"`
	Suggestion *string `json:"suggestion,omitempty"`
	Message    string  `json:"message"`
	Path       string  `json:"path"`
}

CodeownersError represents a syntax error detected in the CODEOWNERS file.

func (*CodeownersError) GetColumn

func (c *CodeownersError) GetColumn() int

GetColumn returns the Column field.

func (*CodeownersError) GetKind

func (c *CodeownersError) GetKind() string

GetKind returns the Kind field.

func (*CodeownersError) GetLine

func (c *CodeownersError) GetLine() int

GetLine returns the Line field.

func (*CodeownersError) GetMessage

func (c *CodeownersError) GetMessage() string

GetMessage returns the Message field.

func (*CodeownersError) GetPath

func (c *CodeownersError) GetPath() string

GetPath returns the Path field.

func (*CodeownersError) GetSource

func (c *CodeownersError) GetSource() string

GetSource returns the Source field.

func (*CodeownersError) GetSuggestion

func (c *CodeownersError) GetSuggestion() string

GetSuggestion returns the Suggestion field if it's non-nil, zero value otherwise.

type CodeownersErrors

type CodeownersErrors struct {
	Errors []*CodeownersError `json:"errors"`
}

CodeownersErrors represents a list of syntax errors detected in the CODEOWNERS file.

func (*CodeownersErrors) GetErrors

func (c *CodeownersErrors) GetErrors() []*CodeownersError

GetErrors returns the Errors slice if it's non-nil, nil otherwise.

type CodesOfConductService

type CodesOfConductService service

CodesOfConductService provides access to code-of-conduct-related functions in the GitHub API.

func (*CodesOfConductService) Get

Get returns an individual code of conduct.

GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct?apiVersion=2022-11-28#get-a-code-of-conduct

func (*CodesOfConductService) List

List returns all codes of conduct.

GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct?apiVersion=2022-11-28#get-all-codes-of-conduct

type Codespace

type Codespace struct {
	ID                             *int64                        `json:"id,omitempty"`
	Name                           *string                       `json:"name,omitempty"`
	DisplayName                    *string                       `json:"display_name,omitempty"`
	EnvironmentID                  *string                       `json:"environment_id,omitempty"`
	Owner                          *User                         `json:"owner,omitempty"`
	BillableOwner                  *User                         `json:"billable_owner,omitempty"`
	Repository                     *Repository                   `json:"repository,omitempty"`
	Machine                        *CodespacesMachine            `json:"machine,omitempty"`
	DevcontainerPath               *string                       `json:"devcontainer_path,omitempty"`
	Prebuild                       *bool                         `json:"prebuild,omitempty"`
	CreatedAt                      *Timestamp                    `json:"created_at,omitempty"`
	UpdatedAt                      *Timestamp                    `json:"updated_at,omitempty"`
	LastUsedAt                     *Timestamp                    `json:"last_used_at,omitempty"`
	State                          *string                       `json:"state,omitempty"`
	URL                            *string                       `json:"url,omitempty"`
	GitStatus                      *CodespacesGitStatus          `json:"git_status,omitempty"`
	Location                       *string                       `json:"location,omitempty"`
	IdleTimeoutMinutes             *int                          `json:"idle_timeout_minutes,omitempty"`
	WebURL                         *string                       `json:"web_url,omitempty"`
	MachinesURL                    *string                       `json:"machines_url,omitempty"`
	StartURL                       *string                       `json:"start_url,omitempty"`
	StopURL                        *string                       `json:"stop_url,omitempty"`
	PullsURL                       *string                       `json:"pulls_url,omitempty"`
	RecentFolders                  []string                      `json:"recent_folders,omitempty"`
	RuntimeConstraints             *CodespacesRuntimeConstraints `json:"runtime_constraints,omitempty"`
	PendingOperation               *bool                         `json:"pending_operation,omitempty"`
	PendingOperationDisabledReason *string                       `json:"pending_operation_disabled_reason,omitempty"`
	IdleTimeoutNotice              *string                       `json:"idle_timeout_notice,omitempty"`
	RetentionPeriodMinutes         *int                          `json:"retention_period_minutes,omitempty"`
	RetentionExpiresAt             *Timestamp                    `json:"retention_expires_at,omitempty"`
	LastKnownStopNotice            *string                       `json:"last_known_stop_notice,omitempty"`
}

Codespace represents a codespace.

GitHub API docs: https://docs.github.com/rest/codespaces?apiVersion=2022-11-28

func (*Codespace) GetBillableOwner

func (c *Codespace) GetBillableOwner() *User

GetBillableOwner returns the BillableOwner field.

func (*Codespace) GetCreatedAt

func (c *Codespace) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Codespace) GetDevcontainerPath

func (c *Codespace) GetDevcontainerPath() string

GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise.

func (*Codespace) GetDisplayName

func (c *Codespace) GetDisplayName() string

GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.

func (*Codespace) GetEnvironmentID

func (c *Codespace) GetEnvironmentID() string

GetEnvironmentID returns the EnvironmentID field if it's non-nil, zero value otherwise.

func (*Codespace) GetGitStatus

func (c *Codespace) GetGitStatus() *CodespacesGitStatus

GetGitStatus returns the GitStatus field.

func (*Codespace) GetID

func (c *Codespace) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Codespace) GetIdleTimeoutMinutes

func (c *Codespace) GetIdleTimeoutMinutes() int

GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise.

func (*Codespace) GetIdleTimeoutNotice

func (c *Codespace) GetIdleTimeoutNotice() string

GetIdleTimeoutNotice returns the IdleTimeoutNotice field if it's non-nil, zero value otherwise.

func (*Codespace) GetLastKnownStopNotice

func (c *Codespace) GetLastKnownStopNotice() string

GetLastKnownStopNotice returns the LastKnownStopNotice field if it's non-nil, zero value otherwise.

func (*Codespace) GetLastUsedAt

func (c *Codespace) GetLastUsedAt() Timestamp

GetLastUsedAt returns the LastUsedAt field if it's non-nil, zero value otherwise.

func (*Codespace) GetLocation

func (c *Codespace) GetLocation() string

GetLocation returns the Location field if it's non-nil, zero value otherwise.

func (*Codespace) GetMachine

func (c *Codespace) GetMachine() *CodespacesMachine

GetMachine returns the Machine field.

func (*Codespace) GetMachinesURL

func (c *Codespace) GetMachinesURL() string

GetMachinesURL returns the MachinesURL field if it's non-nil, zero value otherwise.

func (*Codespace) GetName

func (c *Codespace) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Codespace) GetOwner

func (c *Codespace) GetOwner() *User

GetOwner returns the Owner field.

func (*Codespace) GetPendingOperation

func (c *Codespace) GetPendingOperation() bool

GetPendingOperation returns the PendingOperation field if it's non-nil, zero value otherwise.

func (*Codespace) GetPendingOperationDisabledReason

func (c *Codespace) GetPendingOperationDisabledReason() string

GetPendingOperationDisabledReason returns the PendingOperationDisabledReason field if it's non-nil, zero value otherwise.

func (*Codespace) GetPrebuild

func (c *Codespace) GetPrebuild() bool

GetPrebuild returns the Prebuild field if it's non-nil, zero value otherwise.

func (*Codespace) GetPullsURL

func (c *Codespace) GetPullsURL() string

GetPullsURL returns the PullsURL field if it's non-nil, zero value otherwise.

func (*Codespace) GetRecentFolders

func (c *Codespace) GetRecentFolders() []string

GetRecentFolders returns the RecentFolders slice if it's non-nil, nil otherwise.

func (*Codespace) GetRepository

func (c *Codespace) GetRepository() *Repository

GetRepository returns the Repository field.

func (*Codespace) GetRetentionExpiresAt

func (c *Codespace) GetRetentionExpiresAt() Timestamp

GetRetentionExpiresAt returns the RetentionExpiresAt field if it's non-nil, zero value otherwise.

func (*Codespace) GetRetentionPeriodMinutes

func (c *Codespace) GetRetentionPeriodMinutes() int

GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise.

func (*Codespace) GetRuntimeConstraints

func (c *Codespace) GetRuntimeConstraints() *CodespacesRuntimeConstraints

GetRuntimeConstraints returns the RuntimeConstraints field.

func (*Codespace) GetStartURL

func (c *Codespace) GetStartURL() string

GetStartURL returns the StartURL field if it's non-nil, zero value otherwise.

func (*Codespace) GetState

func (c *Codespace) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*Codespace) GetStopURL

func (c *Codespace) GetStopURL() string

GetStopURL returns the StopURL field if it's non-nil, zero value otherwise.

func (*Codespace) GetURL

func (c *Codespace) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Codespace) GetUpdatedAt

func (c *Codespace) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (*Codespace) GetWebURL

func (c *Codespace) GetWebURL() string

GetWebURL returns the WebURL field if it's non-nil, zero value otherwise.

type CodespaceCreateForUserOptions

type CodespaceCreateForUserOptions struct {
	PullRequest *CodespacePullRequestOptions `json:"pull_request"`
	// RepositoryID represents the repository ID for this codespace.
	RepositoryID               int64   `json:"repository_id"`
	Ref                        *string `json:"ref,omitempty"`
	Geo                        *string `json:"geo,omitempty"`
	ClientIP                   *string `json:"client_ip,omitempty"`
	RetentionPeriodMinutes     *int    `json:"retention_period_minutes,omitempty"`
	Location                   *string `json:"location,omitempty"`
	Machine                    *string `json:"machine,omitempty"`
	DevcontainerPath           *string `json:"devcontainer_path,omitempty"`
	MultiRepoPermissionsOptOut *bool   `json:"multi_repo_permissions_opt_out,omitempty"`
	WorkingDirectory           *string `json:"working_directory,omitempty"`
	IdleTimeoutMinutes         *int    `json:"idle_timeout_minutes,omitempty"`
	DisplayName                *string `json:"display_name,omitempty"`
}

CodespaceCreateForUserOptions represents options for creating a codespace for the authenticated user.

func (*CodespaceCreateForUserOptions) GetClientIP

func (c *CodespaceCreateForUserOptions) GetClientIP() string

GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise.

func (*CodespaceCreateForUserOptions) GetDevcontainerPath

func (c *CodespaceCreateForUserOptions) GetDevcontainerPath() string

GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise.

func (*CodespaceCreateForUserOptions) GetDisplayName

func (c *CodespaceCreateForUserOptions) GetDisplayName() string

GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.

func (*CodespaceCreateForUserOptions) GetGeo

GetGeo returns the Geo field if it's non-nil, zero value otherwise.

func (*CodespaceCreateForUserOptions) GetIdleTimeoutMinutes

func (c *CodespaceCreateForUserOptions) GetIdleTimeoutMinutes() int

GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise.

func (*CodespaceCreateForUserOptions) GetLocation

func (c *CodespaceCreateForUserOptions) GetLocation() string

GetLocation returns the Location field if it's non-nil, zero value otherwise.

func (*CodespaceCreateForUserOptions) GetMachine

func (c *CodespaceCreateForUserOptions) GetMachine() string

GetMachine returns the Machine field if it's non-nil, zero value otherwise.

func (*CodespaceCreateForUserOptions) GetMultiRepoPermissionsOptOut

func (c *CodespaceCreateForUserOptions) GetMultiRepoPermissionsOptOut() bool

GetMultiRepoPermissionsOptOut returns the MultiRepoPermissionsOptOut field if it's non-nil, zero value otherwise.

func (*CodespaceCreateForUserOptions) GetPullRequest

GetPullRequest returns the PullRequest field.

func (*CodespaceCreateForUserOptions) GetRef

GetRef returns the Ref field if it's non-nil, zero value otherwise.

func (*CodespaceCreateForUserOptions) GetRepositoryID

func (c *CodespaceCreateForUserOptions) GetRepositoryID() int64

GetRepositoryID returns the RepositoryID field.

func (*CodespaceCreateForUserOptions) GetRetentionPeriodMinutes

func (c *CodespaceCreateForUserOptions) GetRetentionPeriodMinutes() int

GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise.

func (*CodespaceCreateForUserOptions) GetWorkingDirectory

func (c *CodespaceCreateForUserOptions) GetWorkingDirectory() string

GetWorkingDirectory returns the WorkingDirectory field if it's non-nil, zero value otherwise.

type CodespaceDefaultAttributes

type CodespaceDefaultAttributes struct {
	BillableOwner *User              `json:"billable_owner"`
	Defaults      *CodespaceDefaults `json:"defaults"`
}

CodespaceDefaultAttributes represents the default attributes for codespaces created by the user with the repository.

func (*CodespaceDefaultAttributes) GetBillableOwner

func (c *CodespaceDefaultAttributes) GetBillableOwner() *User

GetBillableOwner returns the BillableOwner field.

func (*CodespaceDefaultAttributes) GetDefaults

GetDefaults returns the Defaults field.

type CodespaceDefaults

type CodespaceDefaults struct {
	Location         string  `json:"location"`
	DevcontainerPath *string `json:"devcontainer_path,omitempty"`
}

CodespaceDefaults represents default settings for a Codespace.

func (*CodespaceDefaults) GetDevcontainerPath

func (c *CodespaceDefaults) GetDevcontainerPath() string

GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise.

func (*CodespaceDefaults) GetLocation

func (c *CodespaceDefaults) GetLocation() string

GetLocation returns the Location field.

type CodespaceExport

type CodespaceExport struct {
	// Can be one of: `succeeded`, `failed`, `in_progress`.
	State       *string    `json:"state,omitempty"`
	CompletedAt *Timestamp `json:"completed_at,omitempty"`
	Branch      *string    `json:"branch,omitempty"`
	SHA         *string    `json:"sha,omitempty"`
	ID          *string    `json:"id,omitempty"`
	ExportURL   *string    `json:"export_url,omitempty"`
	HTMLURL     *string    `json:"html_url,omitempty"`
}

CodespaceExport represents an export of a codespace.

func (*CodespaceExport) GetBranch

func (c *CodespaceExport) GetBranch() string

GetBranch returns the Branch field if it's non-nil, zero value otherwise.

func (*CodespaceExport) GetCompletedAt

func (c *CodespaceExport) GetCompletedAt() Timestamp

GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.

func (*CodespaceExport) GetExportURL

func (c *CodespaceExport) GetExportURL() string

GetExportURL returns the ExportURL field if it's non-nil, zero value otherwise.

func (*CodespaceExport) GetHTMLURL

func (c *CodespaceExport) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*CodespaceExport) GetID

func (c *CodespaceExport) GetID() string

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*CodespaceExport) GetSHA

func (c *CodespaceExport) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*CodespaceExport) GetState

func (c *CodespaceExport) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

type CodespaceGetDefaultAttributesOptions

type CodespaceGetDefaultAttributesOptions struct {
	// Ref represents the branch or commit to check for a default devcontainer path. If not specified, the default branch will be checked.
	Ref *string `url:"ref,omitempty"`
	// ClientIP represents an alternative IP for default location auto-detection, such as when proxying a request.
	ClientIP *string `url:"client_ip,omitempty"`
}

CodespaceGetDefaultAttributesOptions represents options for getting default attributes for a codespace.

func (*CodespaceGetDefaultAttributesOptions) GetClientIP

GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise.

func (*CodespaceGetDefaultAttributesOptions) GetRef

GetRef returns the Ref field if it's non-nil, zero value otherwise.

type CodespacePermissions

type CodespacePermissions struct {
	Accepted bool `json:"accepted"`
}

CodespacePermissions represents a response indicating whether the permissions defined by a devcontainer have been accepted.

func (*CodespacePermissions) GetAccepted

func (c *CodespacePermissions) GetAccepted() bool

GetAccepted returns the Accepted field.

type CodespacePullRequestOptions

type CodespacePullRequestOptions struct {
	// PullRequestNumber represents the pull request number.
	PullRequestNumber int64 `json:"pull_request_number"`
	// RepositoryID represents the repository ID for this codespace.
	RepositoryID int64 `json:"repository_id"`
}

CodespacePullRequestOptions represents options for a CodespacePullRequest.

func (*CodespacePullRequestOptions) GetPullRequestNumber

func (c *CodespacePullRequestOptions) GetPullRequestNumber() int64

GetPullRequestNumber returns the PullRequestNumber field.

func (*CodespacePullRequestOptions) GetRepositoryID

func (c *CodespacePullRequestOptions) GetRepositoryID() int64

GetRepositoryID returns the RepositoryID field.

type CodespacesGitStatus

type CodespacesGitStatus struct {
	Ahead                 *int    `json:"ahead,omitempty"`
	Behind                *int    `json:"behind,omitempty"`
	HasUnpushedChanges    *bool   `json:"has_unpushed_changes,omitempty"`
	HasUncommittedChanges *bool   `json:"has_uncommitted_changes,omitempty"`
	Ref                   *string `json:"ref,omitempty"`
}

CodespacesGitStatus represents the git status of a codespace.

func (*CodespacesGitStatus) GetAhead

func (c *CodespacesGitStatus) GetAhead() int

GetAhead returns the Ahead field if it's non-nil, zero value otherwise.

func (*CodespacesGitStatus) GetBehind

func (c *CodespacesGitStatus) GetBehind() int

GetBehind returns the Behind field if it's non-nil, zero value otherwise.

func (*CodespacesGitStatus) GetHasUncommittedChanges

func (c *CodespacesGitStatus) GetHasUncommittedChanges() bool

GetHasUncommittedChanges returns the HasUncommittedChanges field if it's non-nil, zero value otherwise.

func (*CodespacesGitStatus) GetHasUnpushedChanges

func (c *CodespacesGitStatus) GetHasUnpushedChanges() bool

GetHasUnpushedChanges returns the HasUnpushedChanges field if it's non-nil, zero value otherwise.

func (*CodespacesGitStatus) GetRef

func (c *CodespacesGitStatus) GetRef() string

GetRef returns the Ref field if it's non-nil, zero value otherwise.

type CodespacesMachine

type CodespacesMachine struct {
	Name                 *string `json:"name,omitempty"`
	DisplayName          *string `json:"display_name,omitempty"`
	OperatingSystem      *string `json:"operating_system,omitempty"`
	StorageInBytes       *int64  `json:"storage_in_bytes,omitempty"`
	MemoryInBytes        *int64  `json:"memory_in_bytes,omitempty"`
	CPUs                 *int    `json:"cpus,omitempty"`
	PrebuildAvailability *string `json:"prebuild_availability,omitempty"`
}

CodespacesMachine represents the machine type of a codespace.

func (*CodespacesMachine) GetCPUs

func (c *CodespacesMachine) GetCPUs() int

GetCPUs returns the CPUs field if it's non-nil, zero value otherwise.

func (*CodespacesMachine) GetDisplayName

func (c *CodespacesMachine) GetDisplayName() string

GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.

func (*CodespacesMachine) GetMemoryInBytes

func (c *CodespacesMachine) GetMemoryInBytes() int64

GetMemoryInBytes returns the MemoryInBytes field if it's non-nil, zero value otherwise.

func (*CodespacesMachine) GetName

func (c *CodespacesMachine) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CodespacesMachine) GetOperatingSystem

func (c *CodespacesMachine) GetOperatingSystem() string

GetOperatingSystem returns the OperatingSystem field if it's non-nil, zero value otherwise.

func (*CodespacesMachine) GetPrebuildAvailability

func (c *CodespacesMachine) GetPrebuildAvailability() string

GetPrebuildAvailability returns the PrebuildAvailability field if it's non-nil, zero value otherwise.

func (*CodespacesMachine) GetStorageInBytes

func (c *CodespacesMachine) GetStorageInBytes() int64

GetStorageInBytes returns the StorageInBytes field if it's non-nil, zero value otherwise.

type CodespacesMachines

type CodespacesMachines struct {
	TotalCount int64                `json:"total_count"`
	Machines   []*CodespacesMachine `json:"machines"`
}

CodespacesMachines represent a list of machines.

func (*CodespacesMachines) GetMachines

func (c *CodespacesMachines) GetMachines() []*CodespacesMachine

GetMachines returns the Machines slice if it's non-nil, nil otherwise.

func (*CodespacesMachines) GetTotalCount

func (c *CodespacesMachines) GetTotalCount() int64

GetTotalCount returns the TotalCount field.

type CodespacesOrgAccessControlRequest

type CodespacesOrgAccessControlRequest struct {
	// Visibility represent which users can access codespaces in the organization.
	// Can be one of: disabled, selected_members, all_members, all_members_and_outside_collaborators.
	Visibility string `json:"visibility"`
	// SelectedUsernames represent the usernames of the organization members who should have access to codespaces in the organization.
	// Required when visibility is selected_members.
	SelectedUsernames []string `json:"selected_usernames,omitzero"`
}

CodespacesOrgAccessControlRequest represent request for SetOrgAccessControl.

func (*CodespacesOrgAccessControlRequest) GetSelectedUsernames

func (c *CodespacesOrgAccessControlRequest) GetSelectedUsernames() []string

GetSelectedUsernames returns the SelectedUsernames slice if it's non-nil, nil otherwise.

func (*CodespacesOrgAccessControlRequest) GetVisibility

func (c *CodespacesOrgAccessControlRequest) GetVisibility() string

GetVisibility returns the Visibility field.

type CodespacesRuntimeConstraints

type CodespacesRuntimeConstraints struct {
	AllowedPortPrivacySettings []string `json:"allowed_port_privacy_settings,omitempty"`
}

CodespacesRuntimeConstraints represents the runtime constraints of a codespace.

func (*CodespacesRuntimeConstraints) GetAllowedPortPrivacySettings

func (c *CodespacesRuntimeConstraints) GetAllowedPortPrivacySettings() []string

GetAllowedPortPrivacySettings returns the AllowedPortPrivacySettings slice if it's non-nil, nil otherwise.

type CodespacesService

type CodespacesService service

CodespacesService handles communication with the Codespaces related methods of the GitHub API.

GitHub API docs: https://docs.github.com/rest/codespaces?apiVersion=2022-11-28

func (*CodespacesService) AddSelectedRepoToOrgSecret

func (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error)

AddSelectedRepoToOrgSecret adds a repository to the list of repositories that have been granted the ability to use an organization's codespace secret.

Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret

func (*CodespacesService) AddSelectedRepoToUserSecret

func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error)

AddSelectedRepoToUserSecret adds a repository to the list of repositories that have been granted the ability to use a user's codespace secret.

Adds a repository to the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on the referenced repository to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#add-a-selected-repository-to-a-user-secret

func (*CodespacesService) AddUsersToOrgAccess

func (s *CodespacesService) AddUsersToOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error)

AddUsersToOrgAccess adds users to Codespaces access for an organization.

GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#add-users-to-codespaces-access-for-an-organization

func (*CodespacesService) CheckPermissions

func (s *CodespacesService) CheckPermissions(ctx context.Context, owner, repo, ref, devcontainerPath string) (*CodespacePermissions, *Response, error)

CheckPermissions checks whether the permissions defined by a given devcontainer configuration have been accepted by the authenticated user.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user

func (*CodespacesService) Create

Create creates a new codespace, owned by the authenticated user.

This method requires either RepositoryId OR a PullRequest but not both.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-for-the-authenticated-user

func (*CodespacesService) CreateFromPullRequest

func (s *CodespacesService) CreateFromPullRequest(ctx context.Context, owner, repo string, pullNumber int, request *CreateCodespaceOptions) (*Codespace, *Response, error)

CreateFromPullRequest creates a codespace owned by the authenticated user for the specified pull request.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-from-a-pull-request

func (*CodespacesService) CreateInRepo

func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string, request *CreateCodespaceOptions) (*Codespace, *Response, error)

CreateInRepo creates a codespace in a repository.

Creates a codespace owned by the authenticated user in the specified repository. You must authenticate using an access token with the codespace scope to use this endpoint. GitHub Apps must have write access to the codespaces repository permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-in-a-repository

func (*CodespacesService) CreateOrUpdateOrgSecret

func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error)

CreateOrUpdateOrgSecret creates or updates an orgs codespace secret

Creates or updates an organization secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the admin:org scope to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret

func (*CodespacesService) CreateOrUpdateRepoSecret

func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error)

CreateOrUpdateRepoSecret creates or updates a repos codespace secret

Creates or updates a repository secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret

func (*CodespacesService) CreateOrUpdateUserSecret

func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error)

CreateOrUpdateUserSecret creates or updates a users codespace secret

Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must also have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission and codespaces_secrets repository permission on all referenced repositories to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#create-or-update-a-secret-for-the-authenticated-user

func (*CodespacesService) Delete

func (s *CodespacesService) Delete(ctx context.Context, codespaceName string) (*Response, error)

Delete deletes a codespace.

You must authenticate using an access token with the codespace scope to use this endpoint. GitHub Apps must have write access to the codespaces repository permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#delete-a-codespace-for-the-authenticated-user

func (*CodespacesService) DeleteOrgSecret

func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error)

DeleteOrgSecret deletes an orgs codespace secret

Deletes an organization secret using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#delete-an-organization-secret

func (*CodespacesService) DeleteRepoSecret

func (s *CodespacesService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error)

DeleteRepoSecret deletes a repos codespace secret

Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret

func (*CodespacesService) DeleteUserCodespaceInOrg

func (s *CodespacesService) DeleteUserCodespaceInOrg(ctx context.Context, org, username, codespaceName string) (*Response, error)

DeleteUserCodespaceInOrg deletes a user's codespace from the organization.

GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#delete-a-codespace-from-the-organization

func (*CodespacesService) DeleteUserSecret

func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) (*Response, error)

DeleteUserSecret deletes a users codespace secret

Deletes a secret from a user's codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#delete-a-secret-for-the-authenticated-user

func (*CodespacesService) ExportCodespace

func (s *CodespacesService) ExportCodespace(ctx context.Context, codespaceName string) (*CodespaceExport, *Response, error)

ExportCodespace triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#export-a-codespace-for-the-authenticated-user

func (*CodespacesService) Get

func (s *CodespacesService) Get(ctx context.Context, codespaceName string) (*Codespace, *Response, error)

Get gets information about a user's codespace.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#get-a-codespace-for-the-authenticated-user

func (*CodespacesService) GetDefaultAttributes

GetDefaultAttributes gets the default attributes for codespaces created by the user with the repository.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#get-default-attributes-for-a-codespace

func (*CodespacesService) GetLatestCodespaceExport

func (s *CodespacesService) GetLatestCodespaceExport(ctx context.Context, codespaceName string) (*CodespaceExport, *Response, error)

GetLatestCodespaceExport gets information about an export of a codespace.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#get-details-about-a-codespace-export

func (*CodespacesService) GetOrgPublicKey

func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error)

GetOrgPublicKey gets the org public key for encrypting codespace secrets

Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-public-key

func (*CodespacesService) GetOrgSecret

func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error)

GetOrgSecret gets an org codespace secret

Gets an organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-secret

func (*CodespacesService) GetRepoPublicKey

func (s *CodespacesService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error)

GetRepoPublicKey gets the repo public key for encrypting codespace secrets

Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-public-key

func (*CodespacesService) GetRepoSecret

func (s *CodespacesService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error)

GetRepoSecret gets a repo codespace secret

Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret

func (*CodespacesService) GetUserPublicKey

func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, *Response, error)

GetUserPublicKey gets the users public key for encrypting codespace secrets

Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#get-public-key-for-the-authenticated-user

func (*CodespacesService) GetUserSecret

func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Secret, *Response, error)

GetUserSecret gets a users codespace secret

Gets a secret available to a user's codespaces without revealing its encrypted value. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#get-a-secret-for-the-authenticated-user

func (*CodespacesService) List

List lists codespaces for an authenticated user.

Lists the authenticated user's codespaces. You must authenticate using an access token with the codespace scope to use this endpoint. GitHub Apps must have read access to the codespaces repository permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-for-the-authenticated-user

func (*CodespacesService) ListCodespaceMachineTypes

func (s *CodespacesService) ListCodespaceMachineTypes(ctx context.Context, codespaceName string) (*CodespacesMachines, *Response, error)

ListCodespaceMachineTypes lists the machine types a codespace can transition to use.

GitHub API docs: https://docs.github.com/rest/codespaces/machines?apiVersion=2022-11-28#list-machine-types-for-a-codespace

func (*CodespacesService) ListDevContainerConfigurations

func (s *CodespacesService) ListDevContainerConfigurations(ctx context.Context, owner, repo string, opts *ListOptions) (*DevContainerConfigurations, *Response, error)

ListDevContainerConfigurations lists devcontainer configurations in a repository for the authenticated user.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user

func (*CodespacesService) ListDevContainerConfigurationsIter

func (s *CodespacesService) ListDevContainerConfigurationsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*DevContainer, error]

ListDevContainerConfigurationsIter returns an iterator that paginates through all results of ListDevContainerConfigurations.

func (*CodespacesService) ListInOrg

func (s *CodespacesService) ListInOrg(ctx context.Context, org string, opts *ListOptions) (*ListCodespaces, *Response, error)

ListInOrg lists the codespaces associated to a specified organization.

GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#list-codespaces-for-the-organization

func (*CodespacesService) ListInOrgIter

func (s *CodespacesService) ListInOrgIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Codespace, error]

ListInOrgIter returns an iterator that paginates through all results of ListInOrg.

func (*CodespacesService) ListInRepo

func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, opts *ListOptions) (*ListCodespaces, *Response, error)

ListInRepo lists codespaces for a user in a repository.

Lists the codespaces associated with a specified repository and the authenticated user. You must authenticate using an access token with the codespace scope to use this endpoint. GitHub Apps must have read access to the codespaces repository permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-in-a-repository-for-the-authenticated-user

func (*CodespacesService) ListInRepoIter

func (s *CodespacesService) ListInRepoIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Codespace, error]

ListInRepoIter returns an iterator that paginates through all results of ListInRepo.

func (*CodespacesService) ListIter

ListIter returns an iterator that paginates through all results of List.

func (*CodespacesService) ListOrgSecrets

func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error)

ListOrgSecrets list all secrets available to an org

Lists all Codespaces secrets available at the organization-level without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-organization-secrets

func (*CodespacesService) ListOrgSecretsIter

func (s *CodespacesService) ListOrgSecretsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Secret, error]

ListOrgSecretsIter returns an iterator that paginates through all results of ListOrgSecrets.

func (*CodespacesService) ListRepoSecrets

func (s *CodespacesService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error)

ListRepoSecrets list all secrets available to a repo

Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#list-repository-secrets

func (*CodespacesService) ListRepoSecretsIter

func (s *CodespacesService) ListRepoSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error]

ListRepoSecretsIter returns an iterator that paginates through all results of ListRepoSecrets.

func (*CodespacesService) ListRepositoryMachineTypes

func (s *CodespacesService) ListRepositoryMachineTypes(ctx context.Context, owner, repo string, opts *ListRepoMachineTypesOptions) (*CodespacesMachines, *Response, error)

ListRepositoryMachineTypes lists the machine types available for a given repository based on its configuration.

GitHub API docs: https://docs.github.com/rest/codespaces/machines?apiVersion=2022-11-28#list-available-machine-types-for-a-repository

func (*CodespacesService) ListSelectedReposForOrgSecret

func (s *CodespacesService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error)

ListSelectedReposForOrgSecret lists the repositories that have been granted the ability to use an organization's codespace secret.

Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret

func (*CodespacesService) ListSelectedReposForOrgSecretIter

func (s *CodespacesService) ListSelectedReposForOrgSecretIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error]

ListSelectedReposForOrgSecretIter returns an iterator that paginates through all results of ListSelectedReposForOrgSecret.

func (*CodespacesService) ListSelectedReposForUserSecret

func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, name string, opts *ListOptions) (*SelectedReposList, *Response, error)

ListSelectedReposForUserSecret lists the repositories that have been granted the ability to use a user's codespace secret.

You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have read access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#list-selected-repositories-for-a-user-secret

func (*CodespacesService) ListSelectedReposForUserSecretIter

func (s *CodespacesService) ListSelectedReposForUserSecretIter(ctx context.Context, name string, opts *ListOptions) iter.Seq2[*Repository, error]

ListSelectedReposForUserSecretIter returns an iterator that paginates through all results of ListSelectedReposForUserSecret.

func (*CodespacesService) ListUserCodespacesInOrg

func (s *CodespacesService) ListUserCodespacesInOrg(ctx context.Context, org, username string, opts *ListOptions) (*ListCodespaces, *Response, error)

ListUserCodespacesInOrg lists the codespaces that a member of an organization has for repositories in that organization.

GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#list-codespaces-for-a-user-in-organization

func (*CodespacesService) ListUserCodespacesInOrgIter

func (s *CodespacesService) ListUserCodespacesInOrgIter(ctx context.Context, org string, username string, opts *ListOptions) iter.Seq2[*Codespace, error]

ListUserCodespacesInOrgIter returns an iterator that paginates through all results of ListUserCodespacesInOrg.

func (*CodespacesService) ListUserSecrets

func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptions) (*Secrets, *Response, error)

ListUserSecrets list all secrets available for a users codespace

Lists all secrets available for a user's Codespaces without revealing their encrypted values You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint.

GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#list-secrets-for-the-authenticated-user

func (*CodespacesService) ListUserSecretsIter

func (s *CodespacesService) ListUserSecretsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Secret, error]

ListUserSecretsIter returns an iterator that paginates through all results of ListUserSecrets.

func (*CodespacesService) Publish

func (s *CodespacesService) Publish(ctx context.Context, codespaceName string, opts *PublishCodespaceOptions) (*Codespace, *Response, error)

Publish publishes an unpublished codespace, creating a new repository and assigning it to the codespace.

GitHub API docs: