go-github: github.com/google/go-github/github Index | Examples | Files

package github

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

Package github provides a client for using the GitHub API.

Usage:

import "github.com/google/go-github/v32/github"	// with go modules enabled (GO111MODULE=on or outside GOPATH)
import "github.com/google/go-github/github"     // with go modules disabled

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

client := github.NewClient(nil)

// 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 := github.NewClient(nil)

// 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/en/rest/reference/.

NOTE: Using the https://godoc.org/context package, one can easily pass cancelation 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

The go-github library does not directly handle authentication. Instead, when creating a new client, pass an http.Client that can handle authentication for you. The easiest and recommended way to do this is using the golang.org/x/oauth2 library, but you can always use any other library that provides an http.Client. If you have an OAuth2 access token (for example, a personal API token), you can use it with the oauth2 library using:

import "golang.org/x/oauth2"

func main() {
	ctx := context.Background()
	ts := oauth2.StaticTokenSource(
		&oauth2.Token{AccessToken: "... your access token ..."},
	)
	tc := oauth2.NewClient(ctx, ts)

	client := github.NewClient(tc)

	// list all repositories for the authenticated user
	repos, _, err := client.Repositories.List(ctx, "", nil)
}

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.

See the oauth2 docs for complete instructions on using that library.

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.

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 := github.NewClient(&http.Client{Transport: itr})

	// 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 *github.RateLimitError:

repos, _, err := client.Repositories.List(ctx, "", nil)
if _, ok := err.(*github.RateLimitError); ok {
	log.Println("hit rate limit")
}

Learn more about GitHub rate limiting at https://docs.github.com/en/rest/reference/#rate-limiting.

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 *github.AcceptedError:

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

Conditional Requests

The GitHub API has good support for conditional requests 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. We recommend using https://github.com/gregjones/httpcache for that.

Learn more about GitHub conditional requests at https://docs.github.com/en/rest/reference/#conditional-requests.

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. Helper functions have 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.String("foo"),
	Private: github.Bool(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 github.ListOptions struct and passed to the list methods directly or as an embedded type of a more specific list options struct (for example github.PullRequestListOptions). Pages information is available via the github.Response struct.

client := github.NewClient(nil)

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

Package Files

actions.go actions_artifacts.go actions_runners.go actions_secrets.go actions_workflow_jobs.go actions_workflow_runs.go actions_workflows.go activity.go activity_events.go activity_notifications.go activity_star.go activity_watching.go admin.go admin_orgs.go admin_stats.go admin_users.go apps.go apps_installation.go apps_manifest.go apps_marketplace.go authorizations.go checks.go code-scanning.go doc.go event.go event_types.go gists.go gists_comments.go git.go git_blobs.go git_commits.go git_refs.go git_tags.go git_trees.go github-accessors.go github.go gitignore.go interactions.go interactions_orgs.go interactions_repos.go issue_import.go issues.go issues_assignees.go issues_comments.go issues_events.go issues_labels.go issues_milestones.go issues_timeline.go licenses.go messages.go migrations.go migrations_source_import.go migrations_user.go misc.go orgs.go orgs_hooks.go orgs_members.go orgs_outside_collaborators.go orgs_projects.go orgs_users_blocking.go packages.go projects.go pulls.go pulls_comments.go pulls_reviewers.go pulls_reviews.go reactions.go repos.go repos_collaborators.go repos_comments.go repos_commits.go repos_community_health.go repos_contents.go repos_deployments.go repos_forks.go repos_hooks.go repos_invitations.go repos_keys.go repos_merging.go repos_pages.go repos_prereceive_hooks.go repos_projects.go repos_releases.go repos_stats.go repos_statuses.go repos_traffic.go search.go strings.go teams.go teams_discussion_comments.go teams_discussions.go teams_members.go timestamp.go users.go users_administration.go users_blocking.go users_emails.go users_followers.go users_gpg_keys.go users_keys.go users_projects.go without_appengine.go

Variables

var ErrMixedCommentStyles = errors.New("cannot use both position and side/line form comments")

func Bool Uses

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.

func CheckResponse Uses

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, and *TwoFactorAuthError for two-factor authentication errors.

func DeliveryID Uses

func DeliveryID(r *http.Request) string

DeliveryID returns the unique delivery ID of webhook request r.

GitHub API docs: https://docs.github.com/en/rest/reference/repos/hooks/#webhook-headers

func Int Uses

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.

func Int64 Uses

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.

func ParseWebHook Uses

func ParseWebHook(messageType string, payload []byte) (interface{}, 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 String Uses

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.

func Stringify Uses

func Stringify(message interface{}) 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 Uses

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 ValidateSignature Uses

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 Uses

func WebHookType(r *http.Request) string

WebHookType returns the event type of webhook request r.

GitHub API docs: https://docs.github.com/en/rest/reference/repos/hooks/#webhook-headers

type APIMeta Uses

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 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"`
}

APIMeta represents metadata about the GitHub API.

func (*APIMeta) GetVerifiablePasswordAuthentication Uses

func (a *APIMeta) GetVerifiablePasswordAuthentication() bool

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

type AbuseRateLimitError Uses

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/en/rest/reference/#abuse-rate-limits".

func (*AbuseRateLimitError) Error Uses

func (r *AbuseRateLimitError) Error() string

func (*AbuseRateLimitError) GetRetryAfter Uses

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

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

type AcceptedError Uses

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 Uses

func (*AcceptedError) Error() string

type ActionsService Uses

type ActionsService service

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

GitHub API docs: https://docs.github.com/en/rest/reference/actions/

func (*ActionsService) AddSelectedRepoToOrgSecret Uses

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/en/rest/reference/actions/#add-selected-repository-to-an-organization-secret

func (*ActionsService) CancelWorkflowRunByID Uses

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

CancelWorkflowRunByID cancels a workflow run by ID.

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#cancel-a-workflow-run

func (*ActionsService) CreateOrUpdateOrgSecret Uses

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/en/rest/reference/actions/#create-or-update-an-organization-secret

func (*ActionsService) CreateOrUpdateRepoSecret Uses

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/en/rest/reference/actions/#create-or-update-a-repository-secret

func (*ActionsService) CreateOrganizationRegistrationToken Uses

func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, owner 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/en/rest/reference/actions/#create-a-registration-token-for-an-organization

func (*ActionsService) CreateOrganizationRemoveToken Uses

func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owner 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/en/rest/reference/actions/#create-a-remove-token-for-an-organization

func (*ActionsService) CreateRegistrationToken Uses

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/en/rest/reference/actions/#create-a-registration-token-for-a-repository

func (*ActionsService) CreateRemoveToken Uses

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/en/rest/reference/actions/#create-a-remove-token-for-a-repository

func (*ActionsService) CreateWorkflowDispatchEvent Uses

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

CreateWorkflowDispatchEvent manually triggers a GitHub Actions workflow run.

GitHub API docs: https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event

func (*ActionsService) DeleteArtifact Uses

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/en/rest/reference/actions/#delete-an-artifact

func (*ActionsService) DeleteOrgSecret Uses

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/en/rest/reference/actions/#delete-an-organization-secret

func (*ActionsService) DeleteRepoSecret Uses

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/en/rest/reference/actions/#delete-a-repository-secret

func (*ActionsService) DeleteWorkflowRunLogs Uses

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

DeleteWorkflowRunLogs deletes all logs for a workflow run.

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#delete-workflow-run-logs

func (*ActionsService) DownloadArtifact Uses

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

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

GitHub API docs: https://docs.github.com/en/rest/reference/actions/artifacts/#download-an-artifact

func (*ActionsService) GetArtifact Uses

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/en/rest/reference/actions/#get-an-artifact

func (*ActionsService) GetOrgPublicKey Uses

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/en/rest/reference/actions/#get-an-organization-public-key

func (*ActionsService) GetOrgSecret Uses

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/en/rest/reference/actions/#get-an-organization-secret

func (*ActionsService) GetOrganizationRunner Uses

func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner 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/en/rest/reference/actions/#get-a-self-hosted-runner-for-an-organization

func (*ActionsService) GetRepoPublicKey Uses

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/en/rest/reference/actions/#get-a-repository-public-key

func (*ActionsService) GetRepoSecret Uses

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/en/rest/reference/actions/#get-a-repository-secret

func (*ActionsService) GetRunner Uses

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/en/rest/reference/actions/#get-a-self-hosted-runner-for-a-repository

func (*ActionsService) GetWorkflowByFileName Uses

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/en/rest/reference/actions/#get-a-workflow

func (*ActionsService) GetWorkflowByID Uses

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/en/rest/reference/actions/#get-a-workflow

func (*ActionsService) GetWorkflowJobByID Uses

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/en/rest/reference/actions/#get-a-job-for-a-workflow-run

func (*ActionsService) GetWorkflowJobLogs Uses

func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, followRedirects bool) (*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/en/rest/reference/actions/#download-job-logs-for-a-workflow-run

func (*ActionsService) GetWorkflowRunByID Uses

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

GetWorkflowRunByID gets a specific workflow run by ID.

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#get-a-workflow-run

func (*ActionsService) GetWorkflowRunLogs Uses

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

GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run.

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#download-workflow-run-logs

func (*ActionsService) GetWorkflowRunUsageByID Uses

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.

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#get-workflow-run-usage

func (*ActionsService) GetWorkflowUsageByFileName Uses

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/en/rest/reference/actions/#get-workflow-usage

func (*ActionsService) GetWorkflowUsageByID Uses

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/en/rest/reference/actions/#get-workflow-usage

func (*ActionsService) ListArtifacts Uses

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

ListArtifacts lists all artifacts that belong to a repository.

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#list-artifacts-for-a-repository

func (*ActionsService) ListOrgSecrets Uses

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/en/rest/reference/actions/#list-organization-secrets

func (*ActionsService) ListOrganizationRunnerApplicationDownloads Uses

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

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

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#list-runner-applications-for-an-organization

func (*ActionsService) ListOrganizationRunners Uses

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

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

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#list-self-hosted-runners-for-an-organization

func (*ActionsService) ListRepoSecrets Uses

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/en/rest/reference/actions/#list-repository-secrets

func (*ActionsService) ListRepositoryWorkflowRuns Uses

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/en/rest/reference/actions/#list-workflow-runs-for-a-repository

func (*ActionsService) ListRunnerApplicationDownloads Uses

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/en/rest/reference/actions/#list-runner-applications-for-a-repository

func (*ActionsService) ListRunners Uses

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

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

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#list-self-hosted-runners-for-a-repository

func (*ActionsService) ListSelectedReposForOrgSecret Uses

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

ListSelectedReposForOrgSecret lists all repositories that have access to a secret.

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#list-selected-repositories-for-an-organization-secret

func (*ActionsService) ListWorkflowJobs Uses

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/en/rest/reference/actions/#list-jobs-for-a-workflow-run

func (*ActionsService) ListWorkflowRunArtifacts Uses

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/en/rest/reference/actions/#list-workflow-run-artifacts

func (*ActionsService) ListWorkflowRunsByFileName Uses

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/en/rest/reference/actions/#list-workflow-runs

func (*ActionsService) ListWorkflowRunsByID Uses

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/en/rest/reference/actions/#list-workflow-runs

func (*ActionsService) ListWorkflows Uses

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/en/rest/reference/actions/#list-repository-workflows

func (*ActionsService) RemoveOrganizationRunner Uses

func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, owner 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/en/rest/reference/actions/#delete-a-self-hosted-runner-from-an-organization

func (*ActionsService) RemoveRunner Uses

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/en/rest/reference/actions/#delete-a-self-hosted-runner-from-a-repository

func (*ActionsService) RemoveSelectedRepoFromOrgSecret Uses

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/en/rest/reference/actions/#remove-selected-repository-from-an-organization-secret

func (*ActionsService) RerunWorkflowByID Uses

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

RerunWorkflowByID re-runs a workflow by ID.

GitHub API docs: https://docs.github.com/en/rest/reference/actions/#re-run-a-workflow

func (*ActionsService) SetSelectedReposForOrgSecret Uses

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/en/rest/reference/actions/#set-selected-repositories-for-an-organization-secret

type ActivityListStarredOptions Uses

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.

type ActivityService Uses

type ActivityService service

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

GitHub API docs: https://docs.github.com/en/rest/reference/activity/

func (*ActivityService) DeleteRepositorySubscription Uses

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/en/rest/reference/activity/#delete-a-repository-subscription

func (*ActivityService) DeleteThreadSubscription Uses

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/en/rest/reference/activity/#delete-a-thread-subscription

func (*ActivityService) GetRepositorySubscription Uses

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/en/rest/reference/activity/#get-a-repository-subscription

func (*ActivityService) GetThread Uses

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/en/rest/reference/activity/#get-a-thread

func (*ActivityService) GetThreadSubscription Uses

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/en/rest/reference/activity/#get-a-thread-subscription-for-the-authenticated-user

func (*ActivityService) IsStarred Uses

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/en/rest/reference/activity/#check-if-a-repository-is-starred-by-the-authenticated-user

func (*ActivityService) ListEvents Uses

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/en/rest/reference/activity/#list-public-events

func (*ActivityService) ListEventsForOrganization Uses

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/en/rest/reference/activity/#list-public-organization-events

func (*ActivityService) ListEventsForRepoNetwork Uses

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/en/rest/reference/activity/#list-public-events-for-a-network-of-repositories

func (*ActivityService) ListEventsPerformedByUser Uses

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/en/rest/reference/activity/#list-events-for-the-authenticated-user GitHub API docs: https://docs.github.com/en/rest/reference/activity/#list-public-events-for-a-user

func (*ActivityService) ListEventsReceivedByUser Uses

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/en/rest/reference/activity/#list-events-received-by-the-authenticated-user GitHub API docs: https://docs.github.com/en/rest/reference/activity/#list-public-events-received-by-a-user

func (*ActivityService) ListFeeds Uses

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.

func (*ActivityService) ListIssueEventsForRepository Uses

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/en/rest/reference/issues/#list-issue-events-for-a-repository

func (*ActivityService) ListNotifications Uses

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/en/rest/reference/activity/#list-notifications-for-the-authenticated-user

func (*ActivityService) ListRepositoryEvents Uses

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/en/rest/reference/activity/#list-repository-events

func (*ActivityService) ListRepositoryNotifications Uses

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/en/rest/reference/activity/#list-repository-notifications-for-the-authenticated-user

func (*ActivityService) ListStargazers Uses

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/en/rest/reference/activity/#list-stargazers

func (*ActivityService) ListStarred Uses

func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *ActivityListStarredOptions) ([]*StarredRepository, *Response, error)

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/en/rest/reference/activity/#list-repositories-starred-by-the-authenticated-user GitHub API docs: https://docs.github.com/en/rest/reference/activity/#list-repositories-starred-by-a-user

func (*ActivityService) ListUserEventsForOrganization Uses

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/en/rest/reference/activity/#list-organization-events-for-the-authenticated-user

func (*ActivityService) ListWatched Uses

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/en/rest/reference/activity/#list-repositories-watched-by-the-authenticated-user GitHub API docs: https://docs.github.com/en/rest/reference/activity/#list-repositories-watched-by-a-user

func (*ActivityService) ListWatchers Uses

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/en/rest/reference/activity/#list-watchers

func (*ActivityService) MarkNotificationsRead Uses

func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead time.Time) (*Response, error)

MarkNotificationsRead marks all notifications up to lastRead as read.

GitHub API docs: https://docs.github.com/en/rest/reference/activity/notifications/#mark-as-read

func (*ActivityService) MarkRepositoryNotificationsRead Uses

func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead time.Time) (*Response, error)

MarkRepositoryNotificationsRead marks all notifications up to lastRead in the specified repository as read.

GitHub API docs: https://docs.github.com/en/rest/reference/activity/#mark-repository-notifications-as-read

func (*ActivityService) MarkThreadRead Uses

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/en/rest/reference/activity/#mark-a-thread-as-read

func (*ActivityService) SetRepositorySubscription Uses

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/en/rest/reference/activity/#set-a-repository-subscription

func (*ActivityService) SetThreadSubscription Uses

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/en/rest/reference/activity/#set-a-thread-subscription

func (*ActivityService) Star Uses

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/en/rest/reference/activity/#star-a-repository-for-the-authenticated-user

func (*ActivityService) Unstar Uses

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/en/rest/reference/activity/#unstar-a-repository-for-the-authenticated-user

type AdminEnforcement Uses

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) GetURL Uses

func (a *AdminEnforcement) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type AdminService Uses

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/en/rest/reference/enterprise/

func (*AdminService) CreateOrg Uses

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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#create-an-organization

func (*AdminService) CreateUser Uses

func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error)

CreateUser creates a new user in GitHub Enterprise.

GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-a-new-user

func (*AdminService) CreateUserImpersonation Uses

func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error)

CreateUserImpersonation creates an impersonation OAuth token.

GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token

func (*AdminService) DeleteUser Uses

func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error)

DeleteUser deletes a user in GitHub Enterprise.

GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-a-user

func (*AdminService) DeleteUserImpersonation Uses

func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error)

DeleteUserImpersonation deletes an impersonation OAuth token.

GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token

func (*AdminService) GetAdminStats Uses

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/en/rest/reference/enterprise-admin/admin_stats/

func (*AdminService) RenameOrg Uses

func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error)

RenameOrg renames an organization in GitHub Enterprise.

GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization

func (*AdminService) RenameOrgByName Uses

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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization

func (*AdminService) UpdateTeamLDAPMapping Uses

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/en/rest/reference/enterprise/ldap/#update-ldap-mapping-for-a-team

func (*AdminService) UpdateUserLDAPMapping Uses

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/en/rest/reference/enterprise/ldap/#update-ldap-mapping-for-a-user

type AdminStats Uses

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 Uses

func (a *AdminStats) GetComments() *CommentStats

GetComments returns the Comments field.

func (*AdminStats) GetGists Uses

func (a *AdminStats) GetGists() *GistStats

GetGists returns the Gists field.

func (*AdminStats) GetHooks Uses

func (a *AdminStats) GetHooks() *HookStats

GetHooks returns the Hooks field.

func (*AdminStats) GetIssues Uses

func (a *AdminStats) GetIssues() *IssueStats

GetIssues returns the Issues field.

func (*AdminStats) GetMilestones Uses

func (a *AdminStats) GetMilestones() *MilestoneStats

GetMilestones returns the Milestones field.

func (*AdminStats) GetOrgs Uses

func (a *AdminStats) GetOrgs() *OrgStats

GetOrgs returns the Orgs field.

func (*AdminStats) GetPages Uses

func (a *AdminStats) GetPages() *PageStats

GetPages returns the Pages field.

func (*AdminStats) GetPulls Uses

func (a *AdminStats) GetPulls() *PullStats

GetPulls returns the Pulls field.

func (*AdminStats) GetRepos Uses

func (a *AdminStats) GetRepos() *RepoStats

GetRepos returns the Repos field.

func (*AdminStats) GetUsers Uses

func (a *AdminStats) GetUsers() *UserStats

GetUsers returns the Users field.

func (AdminStats) String Uses

func (s AdminStats) String() string

type Alert Uses

type Alert struct {
    RuleID          *string    `json:"rule_id,omitempty"`
    RuleSeverity    *string    `json:"rule_severity,omitempty"`
    RuleDescription *string    `json:"rule_description,omitempty"`
    Tool            *string    `json:"tool,omitempty"`
    CreatedAt       *Timestamp `json:"created_at,omitempty"`
    Open            *bool      `json:"open,omitempty"`
    ClosedBy        *User      `json:"closed_by,omitempty"`
    ClosedAt        *Timestamp `json:"closed_at,omitempty"`
    URL             *string    `json:"url,omitempty"`
    HTMLURL         *string    `json:"html_url,omitempty"`
}

func (*Alert) GetClosedAt Uses

func (a *Alert) GetClosedAt() Timestamp

GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.

func (*Alert) GetClosedBy Uses

func (a *Alert) GetClosedBy() *User

GetClosedBy returns the ClosedBy field.

func (*Alert) GetCreatedAt Uses

func (a *Alert) GetCreatedAt() Timestamp

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

func (*Alert) GetHTMLURL Uses

func (a *Alert) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Alert) GetOpen Uses

func (a *Alert) GetOpen() bool

GetOpen returns the Open field if it's non-nil, zero value otherwise.

func (*Alert) GetRuleDescription Uses

func (a *Alert) GetRuleDescription() string

GetRuleDescription returns the RuleDescription field if it's non-nil, zero value otherwise.

func (*Alert) GetRuleID Uses

func (a *Alert) GetRuleID() string

GetRuleID returns the RuleID field if it's non-nil, zero value otherwise.

func (*Alert) GetRuleSeverity Uses

func (a *Alert) GetRuleSeverity() string

GetRuleSeverity returns the RuleSeverity field if it's non-nil, zero value otherwise.

func (*Alert) GetTool Uses

func (a *Alert) GetTool() string

GetTool returns the Tool field if it's non-nil, zero value otherwise.

func (*Alert) GetURL Uses

func (a *Alert) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Alert) ID Uses

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 AlertListOptions Uses

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 must be formatted as heads/<branch name>.
    Ref string `url:"ref,omitempty"`
}

AlertListOptions specifies optional parameters to the CodeScanningService.ListAlerts method.

type AllowDeletions Uses

type AllowDeletions struct {
    Enabled bool `json:"enabled"`
}

AllowDeletions represents the configuration to accept deletion of protected branches.

type AllowForcePushes Uses

type AllowForcePushes struct {
    Enabled bool `json:"enabled"`
}

AllowForcePushes represents the configuration to accept forced pushes on protected branches.

type App Uses

type App 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"`
    Permissions *InstallationPermissions `json:"permissions,omitempty"`
    Events      []string                 `json:"events,omitempty"`
}

App represents a GitHub App.

func (*App) GetCreatedAt Uses

func (a *App) GetCreatedAt() Timestamp

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

func (*App) GetDescription Uses

func (a *App) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*App) GetExternalURL Uses

func (a *App) GetExternalURL() string

GetExternalURL returns the ExternalURL field if it's non-nil, zero value otherwise.

func (*App) GetHTMLURL Uses

func (a *App) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*App) GetID Uses

func (a *App) GetID() int64

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

func (*App) GetName Uses

func (a *App) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*App) GetNodeID Uses

func (a *App) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*App) GetOwner Uses

func (a *App) GetOwner() *User

GetOwner returns the Owner field.

func (*App) GetPermissions Uses

func (a *App) GetPermissions() *InstallationPermissions

GetPermissions returns the Permissions field.

func (*App) GetSlug Uses

func (a *App) GetSlug() string

GetSlug returns the Slug field if it's non-nil, zero value otherwise.

func (*App) GetUpdatedAt Uses

func (a *App) GetUpdatedAt() Timestamp

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

type AppConfig Uses

type AppConfig struct {
    ID            *int64     `json:"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"`
    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 Uses

func (a *AppConfig) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*AppConfig) GetClientSecret Uses

func (a *AppConfig) GetClientSecret() string

GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise.

func (*AppConfig) GetCreatedAt Uses

func (a *AppConfig) GetCreatedAt() Timestamp

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

func (*AppConfig) GetDescription Uses

func (a *AppConfig) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*AppConfig) GetExternalURL Uses

func (a *AppConfig) GetExternalURL() string

GetExternalURL returns the ExternalURL field if it's non-nil, zero value otherwise.

func (*AppConfig) GetHTMLURL Uses

func (a *AppConfig) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*AppConfig) GetID Uses

func (a *AppConfig) GetID() int64

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

func (*AppConfig) GetName Uses

func (a *AppConfig) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*AppConfig) GetNodeID Uses

func (a *AppConfig) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*AppConfig) GetOwner Uses

func (a *AppConfig) GetOwner() *User

GetOwner returns the Owner field.

func (*AppConfig) GetPEM Uses

func (a *AppConfig) GetPEM() string

GetPEM returns the PEM field if it's non-nil, zero value otherwise.

func (*AppConfig) GetUpdatedAt Uses

func (a *AppConfig) GetUpdatedAt() Timestamp

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

func (*AppConfig) GetWebhookSecret Uses

func (a *AppConfig) GetWebhookSecret() string

GetWebhookSecret returns the WebhookSecret field if it's non-nil, zero value otherwise.

type AppsService Uses

type AppsService service

AppsService provides access to the installation related functions in the GitHub API.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/

func (*AppsService) AddRepository Uses

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/en/rest/reference/apps/#add-a-repository-to-an-app-installation

func (*AppsService) CompleteAppManifest Uses

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/en/rest/reference/apps/#create-a-github-app-from-a-manifest

func (*AppsService) CreateAttachment Uses

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/en/rest/reference/apps/#create-a-content-attachment

func (*AppsService) CreateInstallationToken Uses

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/en/rest/reference/apps/#create-an-installation-access-token-for-an-app

func (*AppsService) DeleteInstallation Uses

func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Response, error)

DeleteInstallation deletes the specified installation.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/#delete-an-installation-for-the-authenticated-app

func (*AppsService) FindOrganizationInstallation Uses

func (s *AppsService) FindOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error)

FindOrganizationInstallation finds the organization's installation information.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/#get-an-organization-installation-for-the-authenticated-app

func (*AppsService) FindRepositoryInstallation Uses

func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error)

FindRepositoryInstallation finds the repository's installation information.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/#get-a-repository-installation-for-the-authenticated-app

func (*AppsService) FindRepositoryInstallationByID Uses

func (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int64) (*Installation, *Response, error)

FindRepositoryInstallationByID finds the repository's installation information.

Note: FindRepositoryInstallationByID uses the undocumented GitHub API endpoint /repositories/:id/installation.

func (*AppsService) FindUserInstallation Uses

func (s *AppsService) FindUserInstallation(ctx context.Context, user string) (*Installation, *Response, error)

FindUserInstallation finds the user's installation information.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/#get-a-user-installation-for-the-authenticated-app

func (*AppsService) Get Uses

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/en/rest/reference/apps/#get-the-authenticated-app GitHub API docs: https://docs.github.com/en/rest/reference/apps/#get-an-app

func (*AppsService) GetInstallation Uses

func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error)

GetInstallation returns the specified installation.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/#get-an-installation-for-the-authenticated-app

func (*AppsService) ListInstallations Uses

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/en/rest/reference/apps/#list-installations-for-the-authenticated-app

func (*AppsService) ListRepos Uses

func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) ([]*Repository, *Response, error)

ListRepos lists the repositories that are accessible to the authenticated installation.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/#list-repositories-accessible-to-the-app-installation

func (*AppsService) ListUserInstallations Uses

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/en/rest/reference/apps/#list-app-installations-accessible-to-the-user-access-token

func (*AppsService) ListUserRepos Uses

func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOptions) ([]*Repository, *Response, error)

ListUserRepos lists repositories that are accessible to the authenticated user for an installation.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/#list-repositories-accessible-to-the-user-access-token

func (*AppsService) RemoveRepository Uses

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/en/rest/reference/apps/#remove-a-repository-from-an-app-installation

func (*AppsService) RevokeInstallationToken Uses

func (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error)

RevokeInstallationToken revokes an installation token.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/#revoke-an-installation-access-token

func (*AppsService) SuspendInstallation Uses

func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Response, error)

SuspendInstallation suspends the specified installation.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/#suspend-an-app-installation

func (*AppsService) UnsuspendInstallation Uses

func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Response, error)

UnsuspendInstallation unsuspends the specified installation.

GitHub API docs: https://docs.github.com/en/rest/reference/apps/#unsuspend-an-app-installation

type ArchiveFormat Uses

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 Artifact Uses

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"`
    ArchiveDownloadURL *string    `json:"archive_download_url,omitempty"`
    Expired            *bool      `json:"expired,omitempty"`
    CreatedAt          *Timestamp `json:"created_at,omitempty"`
    ExpiresAt          *Timestamp `json:"expires_at,omitempty"`
}

Artifact reprents 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/en/rest/reference/actions/artifacts/

func (*Artifact) GetArchiveDownloadURL Uses

func (a *Artifact) GetArchiveDownloadURL() string

GetArchiveDownloadURL returns the ArchiveDownloadURL field if it's non-nil, zero value otherwise.

func (*Artifact) GetCreatedAt Uses

func (a *Artifact) GetCreatedAt() Timestamp

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

func (*Artifact) GetExpired Uses

func (a *Artifact) GetExpired() bool

GetExpired returns the Expired field if it's non-nil, zero value otherwise.

func (*Artifact) GetExpiresAt Uses

func (a *Artifact) GetExpiresAt() Timestamp

GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise.

func (*Artifact) GetID Uses

func (a *Artifact) GetID() int64

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

func (*Artifact) GetName Uses

func (a *Artifact) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Artifact) GetNodeID Uses

func (a *Artifact) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*Artifact) GetSizeInBytes Uses

func (a *Artifact) GetSizeInBytes() int64

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

type ArtifactList Uses

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/en/rest/reference/actions/artifacts/

func (*ArtifactList) GetTotalCount Uses

func (a *ArtifactList) GetTotalCount() int64

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

type Attachment Uses

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 Uses

func (a *Attachment) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*Attachment) GetID Uses

func (a *Attachment) GetID() int64

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

func (*Attachment) GetTitle Uses

func (a *Attachment) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

type Authorization Uses

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 Uses

func (a *Authorization) GetApp() *AuthorizationApp

GetApp returns the App field.

func (*Authorization) GetCreatedAt Uses

func (a *Authorization) GetCreatedAt() Timestamp

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

func (*Authorization) GetFingerprint Uses

func (a *Authorization) GetFingerprint() string

GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.

func (*Authorization) GetHashedToken Uses

func (a *Authorization) GetHashedToken() string

GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise.

func (*Authorization) GetID Uses

func (a *Authorization) GetID() int64

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

func (*Authorization) GetNote Uses

func (a *Authorization) GetNote() string

GetNote returns the Note field if it's non-nil, zero value otherwise.

func (*Authorization) GetNoteURL Uses

func (a *Authorization) GetNoteURL() string

GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.

func (*Authorization) GetToken Uses

func (a *Authorization) GetToken() string

GetToken returns the Token field if it's non-nil, zero value otherwise.

func (*Authorization) GetTokenLastEight Uses

func (a *Authorization) GetTokenLastEight() string

GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise.

func (*Authorization) GetURL Uses

func (a *Authorization) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Authorization) GetUpdatedAt Uses

func (a *Authorization) GetUpdatedAt() Timestamp

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

func (*Authorization) GetUser Uses

func (a *Authorization) GetUser() *User

GetUser returns the User field.

func (Authorization) String Uses

func (a Authorization) String() string

type AuthorizationApp Uses

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 Uses

func (a *AuthorizationApp) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*AuthorizationApp) GetName Uses

func (a *AuthorizationApp) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*AuthorizationApp) GetURL Uses

func (a *AuthorizationApp) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (AuthorizationApp) String Uses

func (a AuthorizationApp) String() string

type AuthorizationRequest Uses

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 Uses

func (a *AuthorizationRequest) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetClientSecret Uses

func (a *AuthorizationRequest) GetClientSecret() string

GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetFingerprint Uses

func (a *AuthorizationRequest) GetFingerprint() string

GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetNote Uses

func (a *AuthorizationRequest) GetNote() string

GetNote returns the Note field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetNoteURL Uses

func (a *AuthorizationRequest) GetNoteURL() string

GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.

func (AuthorizationRequest) String Uses

func (a AuthorizationRequest) String() string

type AuthorizationUpdateRequest Uses

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/en/rest/reference/oauth_authorizations/#update-an-existing-authorization

func (*AuthorizationUpdateRequest) GetFingerprint Uses

func (a *AuthorizationUpdateRequest) GetFingerprint() string

GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.

func (*AuthorizationUpdateRequest) GetNote Uses

func (a *AuthorizationUpdateRequest) GetNote() string

GetNote returns the Note field if it's non-nil, zero value otherwise.

func (*AuthorizationUpdateRequest) GetNoteURL Uses

func (a *AuthorizationUpdateRequest) GetNoteURL() string

GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.

func (AuthorizationUpdateRequest) String Uses

func (a AuthorizationUpdateRequest) String() string

type AuthorizationsService Uses

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/en/rest/reference/oauth_authorizations/

func (*AuthorizationsService) Check Uses

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/en/rest/reference/apps/#check-a-token

func (*AuthorizationsService) CreateImpersonation Uses

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://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token

func (*AuthorizationsService) DeleteGrant Uses

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/en/rest/reference/apps/#delete-an-app-authorization

func (*AuthorizationsService) DeleteImpersonation Uses

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://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token

func (*AuthorizationsService) Reset Uses

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/en/rest/reference/apps/#reset-a-token

func (*AuthorizationsService) Revoke Uses

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/en/rest/reference/apps/#delete-an-app-token

type AutoTriggerCheck Uses

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 Uses

func (a *AutoTriggerCheck) GetAppID() int64

GetAppID returns the AppID field if it's non-nil, zero value otherwise.

func (*AutoTriggerCheck) GetSetting Uses

func (a *AutoTriggerCheck) GetSetting() bool

GetSetting returns the Setting field if it's non-nil, zero value otherwise.

type BasicAuthTransport Uses

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 Uses

func (t *BasicAuthTransport) Client() *http.Client

Client returns an *http.Client that makes requests that are authenticated using HTTP Basic Authentication.

func (*BasicAuthTransport) RoundTrip Uses

func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface.

type Blob Uses

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 Uses

func (b *Blob) GetContent() string

GetContent returns the Content field if it's non-nil, zero value otherwise.

func (*Blob) GetEncoding Uses

func (b *Blob) GetEncoding() string

GetEncoding returns the Encoding field if it's non-nil, zero value otherwise.

func (*Blob) GetNodeID Uses

func (b *Blob) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*Blob) GetSHA Uses

func (b *Blob) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*Blob) GetSize Uses

func (b *Blob) GetSize() int

GetSize returns the Size field if it's non-nil, zero value otherwise.

func (*Blob) GetURL Uses

func (b *Blob) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type Branch Uses

type Branch struct {
    Name      *string           `json:"name,omitempty"`
    Commit    *RepositoryCommit `json:"commit,omitempty"`
    Protected *bool             `json:"protected,omitempty"`
}

Branch represents a repository branch

func (*Branch) GetCommit Uses

func (b *Branch) GetCommit() *RepositoryCommit

GetCommit returns the Commit field.

func (*Branch) GetName Uses

func (b *Branch) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Branch) GetProtected Uses

func (b *Branch) GetProtected() bool

GetProtected returns the Protected field if it's non-nil, zero value otherwise.

type BranchCommit Uses

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 Uses

func (b *BranchCommit) GetCommit() *Commit

GetCommit returns the Commit field.

func (*BranchCommit) GetName Uses

func (b *BranchCommit) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*BranchCommit) GetProtected Uses

func (b *BranchCommit) GetProtected() bool

GetProtected returns the Protected field if it's non-nil, zero value otherwise.

type BranchListOptions Uses

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 Uses

func (b *BranchListOptions) GetProtected() bool

GetProtected returns the Protected field if it's non-nil, zero value otherwise.

type BranchRestrictions Uses

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.

type BranchRestrictionsRequest Uses

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,omitempty"`
}

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.

type CheckRun Uses

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 Uses

func (c *CheckRun) GetApp() *App

GetApp returns the App field.

func (*CheckRun) GetCheckSuite Uses

func (c *CheckRun) GetCheckSuite() *CheckSuite

GetCheckSuite returns the CheckSuite field.

func (*CheckRun) GetCompletedAt Uses

func (c *CheckRun) GetCompletedAt() Timestamp

GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.

func (*CheckRun) GetConclusion Uses

func (c *CheckRun) GetConclusion() string

GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.

func (*CheckRun) GetDetailsURL Uses

func (c *CheckRun) GetDetailsURL() string

GetDetailsURL returns the DetailsURL field if it's non-nil, zero value otherwise.

func (*CheckRun) GetExternalID Uses

func (c *CheckRun) GetExternalID() string

GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise.

func (*CheckRun) GetHTMLURL Uses

func (c *CheckRun) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*CheckRun) GetHeadSHA Uses

func (c *CheckRun) GetHeadSHA() string

GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.

func (*CheckRun) GetID Uses

func (c *CheckRun) GetID() int64

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

func (*CheckRun) GetName Uses

func (c *CheckRun) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CheckRun) GetNodeID Uses

func (c *CheckRun) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*CheckRun) GetOutput Uses

func (c *CheckRun) GetOutput() *CheckRunOutput

GetOutput returns the Output field.

func (*CheckRun) GetStartedAt Uses

func (c *CheckRun) GetStartedAt() Timestamp

GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.

func (*CheckRun) GetStatus Uses

func (c *CheckRun) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*CheckRun) GetURL Uses

func (c *CheckRun) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (CheckRun) String Uses

func (c CheckRun) String() string

type CheckRunAction Uses

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.

type CheckRunAnnotation Uses

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 Uses

func (c *CheckRunAnnotation) GetAnnotationLevel() string

GetAnnotationLevel returns the AnnotationLevel field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetEndColumn Uses

func (c *CheckRunAnnotation) GetEndColumn() int

GetEndColumn returns the EndColumn field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetEndLine Uses

func (c *CheckRunAnnotation) GetEndLine() int

GetEndLine returns the EndLine field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetMessage Uses

func (c *CheckRunAnnotation) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetPath Uses

func (c *CheckRunAnnotation) GetPath() string

GetPath returns the Path field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetRawDetails Uses

func (c *CheckRunAnnotation) GetRawDetails() string

GetRawDetails returns the RawDetails field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetStartColumn Uses

func (c *CheckRunAnnotation) GetStartColumn() int

GetStartColumn returns the StartColumn field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetStartLine Uses

func (c *CheckRunAnnotation) GetStartLine() int

GetStartLine returns the StartLine field if it's non-nil, zero value otherwise.

func (*CheckRunAnnotation) GetTitle Uses

func (c *CheckRunAnnotation) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

type CheckRunEvent Uses

type CheckRunEvent struct {
    CheckRun *CheckRun `json:"check_run,omitempty"`
    // The action performed. Possible values are: "created", "updated", "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", "updated", or "rerequested". The Webhook event name is "check_run".

GitHub API docs: https://docs.github.com/en/rest/reference/activity/events/types/#checkrunevent

func (*CheckRunEvent) GetAction Uses

func (c *CheckRunEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*CheckRunEvent) GetCheckRun Uses

func (c *CheckRunEvent) GetCheckRun() *CheckRun

GetCheckRun returns the CheckRun field.

func (*CheckRunEvent) GetInstallation Uses

func (c *CheckRunEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*CheckRunEvent) GetOrg Uses

func (c *CheckRunEvent) GetOrg() *Organization

GetOrg returns the Org field.

func (*CheckRunEvent) GetRepo Uses

func (c *CheckRunEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*CheckRunEvent) GetRequestedAction Uses

func (c *CheckRunEvent) GetRequestedAction() *RequestedAction

GetRequestedAction returns the RequestedAction field.

func (*CheckRunEvent) GetSender Uses

func (c *CheckRunEvent) GetSender() *User

GetSender returns the Sender field.

type CheckRunImage Uses

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 Uses

func (c *CheckRunImage) GetAlt() string

GetAlt returns the Alt field if it's non-nil, zero value otherwise.

func (*CheckRunImage) GetCaption Uses

func (c *CheckRunImage) GetCaption() string

GetCaption returns the Caption field if it's non-nil, zero value otherwise.

func (*CheckRunImage) GetImageURL Uses

func (c *CheckRunImage) GetImageURL() string

GetImageURL returns the ImageURL field if it's non-nil, zero value otherwise.

type CheckRunOutput Uses

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) GetAnnotationsCount Uses

func (c *CheckRunOutput) GetAnnotationsCount() int

GetAnnotationsCount returns the AnnotationsCount field if it's non-nil, zero value otherwise.

func (*CheckRunOutput) GetAnnotationsURL Uses

func (c *CheckRunOutput) GetAnnotationsURL() string

GetAnnotationsURL returns the AnnotationsURL field if it's non-nil, zero value otherwise.

func (*CheckRunOutput) GetSummary Uses

func (c *CheckRunOutput) GetSummary() string

GetSummary returns the Summary field if it's non-nil, zero value otherwise.

func (*CheckRunOutput) GetText Uses

func (c *CheckRunOutput) GetText() string

GetText returns the Text field if it's non-nil, zero value otherwise.

func (*CheckRunOutput) GetTitle Uses

func (c *CheckRunOutput) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

type CheckSuite Uses

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"`
    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"`
}

CheckSuite represents a suite of check runs.

func (*CheckSuite) GetAfterSHA Uses

func (c *CheckSuite) GetAfterSHA() string

GetAfterSHA returns the AfterSHA field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetApp Uses

func (c *CheckSuite) GetApp() *App

GetApp returns the App field.

func (*CheckSuite) GetBeforeSHA Uses

func (c *CheckSuite) GetBeforeSHA() string

GetBeforeSHA returns the BeforeSHA field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetConclusion Uses

func (c *CheckSuite) GetConclusion() string

GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetHeadBranch Uses

func (c *CheckSuite) GetHeadBranch() string

GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetHeadCommit Uses

func (c *CheckSuite) GetHeadCommit() *Commit

GetHeadCommit returns the HeadCommit field.

func (*CheckSuite) GetHeadSHA Uses

func (c *CheckSuite) GetHeadSHA() string

GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetID Uses

func (c *CheckSuite) GetID() int64

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

func (*CheckSuite) GetNodeID Uses

func (c *CheckSuite) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetRepository Uses

func (c *CheckSuite) GetRepository() *Repository

GetRepository returns the Repository field.

func (*CheckSuite) GetStatus Uses

func (c *CheckSuite) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*CheckSuite) GetURL Uses

func (c *CheckSuite) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (CheckSuite) String Uses

func (c CheckSuite) String() string

type CheckSuiteEvent Uses

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/en/rest/reference/activity/events/types/#checksuiteevent

func (*CheckSuiteEvent) GetAction Uses

func (c *CheckSuiteEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*CheckSuiteEvent) GetCheckSuite Uses

func (c *CheckSuiteEvent) GetCheckSuite() *CheckSuite

GetCheckSuite returns the CheckSuite field.

func (*CheckSuiteEvent) GetInstallation Uses

func (c *CheckSuiteEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*CheckSuiteEvent) GetOrg Uses

func (c *CheckSuiteEvent) GetOrg() *Organization

GetOrg returns the Org field.

func (*CheckSuiteEvent) GetRepo Uses

func (c *CheckSuiteEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*CheckSuiteEvent) GetSender Uses

func (c *CheckSuiteEvent) GetSender() *User

GetSender returns the Sender field.

type CheckSuitePreferenceOptions Uses

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.

type CheckSuitePreferenceResults Uses

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 Uses

func (c *CheckSuitePreferenceResults) GetPreferences() *PreferenceList

GetPreferences returns the Preferences field.

func (*CheckSuitePreferenceResults) GetRepository Uses

func (c *CheckSuitePreferenceResults) GetRepository() *Repository

GetRepository returns the Repository field.

type ChecksService Uses

type ChecksService service

ChecksService provides access to the Checks API in the GitHub API.

GitHub API docs: https://docs.github.com/en/rest/reference/checks/

func (*ChecksService) CreateCheckRun Uses

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/en/rest/reference/checks/#create-a-check-run

func (*ChecksService) CreateCheckSuite Uses

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/en/rest/reference/checks/#create-a-check-suite

func (*ChecksService) GetCheckRun Uses

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/en/rest/reference/checks/#get-a-check-run

func (*ChecksService) GetCheckSuite Uses

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/en/rest/reference/checks/#get-a-check-suite

func (*ChecksService) ListCheckRunAnnotations Uses

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/en/rest/reference/checks/#list-check-run-annotations

func (*ChecksService) ListCheckRunsCheckSuite Uses

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/en/rest/reference/checks/#list-check-runs-in-a-check-suite

func (*ChecksService) ListCheckRunsForRef Uses

func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error)

ListCheckRunsForRef lists check runs for a specific ref.

GitHub API docs: https://docs.github.com/en/rest/reference/checks/#list-check-runs-for-a-git-reference

func (*ChecksService) ListCheckSuitesForRef Uses

func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error)

ListCheckSuitesForRef lists check suite for a specific ref.

GitHub API docs: https://docs.github.com/en/rest/reference/checks/#list-check-suites-for-a-git-reference

func (*ChecksService) ReRequestCheckSuite Uses

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/en/rest/reference/checks/#rerequest-a-check-suite

func (*ChecksService) SetCheckSuitePreferences Uses

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/en/rest/reference/checks/#update-repository-preferences-for-check-suites

func (*ChecksService) UpdateCheckRun Uses

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/en/rest/reference/checks/#update-a-check-run

type Client Uses

type Client struct {

    // Base URL for API requests. Defaults to the public GitHub API, but can be
    // set to a domain endpoint to use with GitHub Enterprise. BaseURL should
    // always be specified with a trailing slash.
    BaseURL *url.URL

    // Base URL for uploading files.
    UploadURL *url.URL

    // User agent used when communicating with the GitHub API.
    UserAgent string

    // Services used for talking to different parts of the GitHub API.
    Actions        *ActionsService
    Activity       *ActivityService
    Admin          *AdminService
    Apps           *AppsService
    Authorizations *AuthorizationsService
    Checks         *ChecksService
    CodeScanning   *CodeScanningService
    Gists          *GistsService
    Git            *GitService
    Gitignores     *GitignoresService
    Interactions   *InteractionsService
    IssueImport    *IssueImportService
    Issues         *IssuesService
    Licenses       *LicensesService
    Marketplace    *MarketplaceService
    Migrations     *MigrationService
    Organizations  *OrganizationsService
    Projects       *ProjectsService
    PullRequests   *PullRequestsService
    Reactions      *ReactionsService
    Repositories   *RepositoriesService
    Search         *SearchService
    Teams          *TeamsService
    Users          *UsersService
    // contains filtered or unexported fields
}

A Client manages communication with the GitHub API.

func NewClient Uses

func NewClient(httpClient *http.Client) *Client

NewClient returns a new GitHub API client. If a nil httpClient is provided, a new http.Client will be used. To use API methods which require authentication, provide an http.Client that will perform the authentication for you (such as that provided by the golang.org/x/oauth2 library).

func NewEnterpriseClient Uses

func NewEnterpriseClient(baseURL, uploadURL string, httpClient *http.Client) (*Client, error)

NewEnterpriseClient returns a new GitHub API client with provided base URL and upload URL (often is your GitHub Enterprise hostname). If the base URL does not have the suffix "/api/v3/", it will be added automatically. If the upload URL does not have the suffix "/api/uploads", it will be added automatically. If a nil httpClient is provided, a new http.Client will be used.

Note that NewEnterpriseClient is a convenience helper only; its behavior is equivalent to using NewClient, followed by setting the BaseURL and UploadURL fields.

Another important thing is that by default, the GitHub Enterprise URL format should be http(s)://[hostname]/api/v3/ or you will always receive the 406 status code. The upload URL format should be http(s)://[hostname]/api/uploads/.

func (*Client) APIMeta Uses

func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error)

APIMeta returns information about GitHub.com, the service. Or, if you access this endpoint on your organization’s GitHub Enterprise installation, this endpoint provides information about that installation.

GitHub API docs: https://docs.github.com/en/rest/reference/meta/

func (*Client) Do Uses

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*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 rate limit is exceeded and reset time is in the future, Do returns *RateLimitError immediately without making a network API call.

The provided ctx must be non-nil, if it is nil an error is returned. If it is canceled or times out, ctx.Err() will be returned.

func (*Client) GetCodeOfConduct Uses

func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error)

GetCodeOfConduct returns an individual code of conduct.

https://docs.github.com/en/rest/reference/codes_of_conduct/#get-an-individual-code-of-conduct

func (*Client) ListCodesOfConduct Uses

func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error)

ListCodesOfConduct returns all codes of conduct.

GitHub API docs: https://docs.github.com/en/rest/reference/codes_of_conduct/#list-all-codes-of-conduct

func (*Client) ListEmojis Uses

func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error)

ListEmojis returns the emojis available to use on GitHub.

GitHub API docs: https://docs.github.com/en/rest/reference/emojis/

func (*Client) ListServiceHooks Uses

func (c *Client) ListServiceHooks(ctx context.Context) ([]*ServiceHook, *Response, error)

ListServiceHooks lists all of the available service hooks.

GitHub API docs: https://developer.github.com/webhooks/#services

func (*Client) Markdown Uses

func (c *Client) Markdown(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error)

Markdown renders an arbitrary Markdown document.

GitHub API docs: https://docs.github.com/en/rest/reference/markdown/

Code:

client := github.NewClient(nil)

input := "# heading #\n\nLink to issue #1"
opt := &github.MarkdownOptions{Mode: "gfm", Context: "google/go-github"}

output, _, err := client.Markdown(context.Background(), input, opt)
if err != nil {
    fmt.Println(err)
}

fmt.Println(output)

func (*Client) NewRequest Uses

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*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 Uses

func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string) (*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 Uses

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.

func (*Client) RateLimits Uses

func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error)

RateLimits returns the rate limits for the current client.

func (*Client) Zen Uses

func (c *Client) Zen(ctx context.Context) (string, *Response, error)

Zen returns a random line from The Zen of GitHub.

see also: http://warpspire.com/posts/taste/

type CodeOfConduct Uses

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 Uses

func (c *CodeOfConduct) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*CodeOfConduct) GetKey Uses

func (c *CodeOfConduct) GetKey() string

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

func (*CodeOfConduct) GetName Uses

func (c *CodeOfConduct) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CodeOfConduct) GetURL Uses

func (c *CodeOfConduct) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*CodeOfConduct) String Uses

func (c *CodeOfConduct) String() string

type CodeResult Uses

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 Uses

func (c *CodeResult) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*CodeResult) GetName Uses

func (c *CodeResult) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CodeResult) GetPath Uses

func (c *CodeResult) GetPath() string

GetPath returns the Path field if it's non-nil, zero value otherwise.

func (*CodeResult) GetRepository Uses

func (c *CodeResult) GetRepository() *Repository

GetRepository returns the Repository field.

func (*CodeResult) GetSHA Uses

func (c *CodeResult) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (CodeResult) String Uses

func (c CodeResult) String() string

type CodeScanningService Uses

type CodeScanningService service

CodeScanningService handles communication with the code scanning related methods of the GitHub API.

GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning/

func (*CodeScanningService) GetAlert Uses

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/en/rest/reference/code-scanning/#get-a-code-scanning-alert

func (*CodeScanningService) ListAlertsForRepo Uses

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/en/rest/reference/code-scanning/#list-code-scanning-alerts-for-a-repository

type CodeSearchResult Uses

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) GetIncompleteResults Uses

func (c *CodeSearchResult) GetIncompleteResults() bool

GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.

func (*CodeSearchResult) GetTotal Uses

func (c *CodeSearchResult) GetTotal() int

GetTotal returns the Total field if it's non-nil, zero value otherwise.

type CollaboratorInvitation Uses

type CollaboratorInvitation struct {
    ID          *int64      `json:"id,omitempty"`
    Repo        *Repository `json:"repository,omitempty"`
    Invitee     *User       `json:"invitee,omitempty"`
    Inviter     *User       `json:"inviter,omitempty"`
    Permissions *string     `json:"permissions,omitempty"`
    CreatedAt   *Timestamp  `json:"created_at,omitempty"`
    URL         *string     `json:"url,omitempty"`
    HTMLURL     *string     `json:"html_url,omitempty"`
}

CollaboratorInvitation represents an invitation created when adding a collaborator. GitHub API docs: https://docs.github.com/en/rest/reference/repos/collaborators/#response-when-a-new-invitation-is-created

func (*CollaboratorInvitation) GetCreatedAt Uses

func (c *CollaboratorInvitation) GetCreatedAt() Timestamp

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

func (*CollaboratorInvitation) GetHTMLURL Uses

func (c *CollaboratorInvitation) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*CollaboratorInvitation) GetID Uses

func (c *CollaboratorInvitation) GetID() int64

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

func (*CollaboratorInvitation) GetInvitee Uses

func (c *CollaboratorInvitation) GetInvitee() *User

GetInvitee returns the Invitee field.

func (*CollaboratorInvitation) GetInviter Uses

func (c *CollaboratorInvitation) GetInviter() *User

GetInviter returns the Inviter field.

func (*CollaboratorInvitation) GetPermissions Uses

func (c *CollaboratorInvitation) GetPermissions() string

GetPermissions returns the Permissions field if it's non-nil, zero value otherwise.

func (*CollaboratorInvitation) GetRepo Uses

func (c *CollaboratorInvitation) GetRepo() *Repository

GetRepo returns the Repo field.

func (*CollaboratorInvitation) GetURL Uses

func (c *CollaboratorInvitation) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type CombinedStatus Uses

type CombinedStatus struct {
    // State is the combined state of the repository. Possible values are:
    // failure, pending, or success.
    State *string `json:"state,omitempty"`

    Name       *string       `json:"name,omitempty"`
    SHA        *string       `json:"sha,omitempty"`
    TotalCount *int          `json:"total_count,omitempty"`
    Statuses   []*RepoStatus `json:"statuses,omitempty"`

    CommitURL     *string `json:"commit_url,omitempty"`
    RepositoryURL *string `json:"repository_url,omitempty"`
}

CombinedStatus represents the combined status of a repository at a particular reference.

func (*CombinedStatus) GetCommitURL Uses

func (c *CombinedStatus) GetCommitURL() string

GetCommitURL returns the CommitURL field if it's non-nil, zero value otherwise.

func (*CombinedStatus) GetName Uses

func (c *CombinedStatus) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CombinedStatus) GetRepositoryURL Uses

func (c *CombinedStatus) GetRepositoryURL() string

GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.

func (*CombinedStatus) GetSHA Uses

func (c *CombinedStatus) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*CombinedStatus) GetState Uses

func (c *CombinedStatus) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*CombinedStatus) GetTotalCount Uses

func (c *CombinedStatus) GetTotalCount() int

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

func (CombinedStatus) String Uses

func (s CombinedStatus) String() string

type Comment Uses

type Comment struct {
    CreatedAt *time.Time `json:"created_at,omitempty"`
    Body      string     `json:"body"`
}

Comment represents comments of issue to import.

func (*Comment) GetCreatedAt Uses

func (c *Comment) GetCreatedAt() time.Time

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

type CommentStats Uses

type CommentStats struct {
    TotalCommitComments      *int `json:"total_commit_comments,omitempty"`
    TotalGistComments        *int `json:"total_gist_comments,omitempty"`
    TotalIssueComments       *int `json:"total_issue_comments,omitempty"`
    TotalPullRequestComments *int `json:"total_pull_request_comments,omitempty"`
}

CommentStats represents the number of total comments on commits, gists, issues and pull requests.

func (*CommentStats) GetTotalCommitComments Uses

func (c *CommentStats) GetTotalCommitComments() int

GetTotalCommitComments returns the TotalCommitComments field if it's non-nil, zero value otherwise.

func (*CommentStats) GetTotalGistComments Uses

func (c *CommentStats) GetTotalGistComments() int

GetTotalGistComments returns the TotalGistComments field if it's non-nil, zero value otherwise.

func (*CommentStats) GetTotalIssueComments Uses

func (c *CommentStats) GetTotalIssueComments() int

GetTotalIssueComments returns the TotalIssueComments field if it's non-nil, zero value otherwise.

func (*CommentStats) GetTotalPullRequestComments Uses

func (c *CommentStats) GetTotalPullRequestComments() int

GetTotalPullRequestComments returns the TotalPullRequestComments field if it's non-nil, zero value otherwise.

func (CommentStats) String Uses

func (s CommentStats) String() string

type Commit Uses

type Commit struct {
    SHA          *string                `json:"sha,omitempty"`
    Author       *CommitAuthor          `json:"author,omitempty"`
    Committer    *CommitAuthor          `json:"committer,omitempty"`
    Message      *string                `json:"message,omitempty"`
    Tree         *Tree                  `json:"tree,omitempty"`
    Parents      []*Commit              `json:"parents,omitempty"`
    Stats        *CommitStats           `json:"stats,omitempty"`
    HTMLURL      *string                `json:"html_url,omitempty"`
    URL          *string                `json:"url,omitempty"`
    Verification *SignatureVerification `json:"verification,omitempty"`
    NodeID       *string                `json:"node_id,omitempty"`

    // CommentCount is the number of GitHub comments on the commit. This
    // is only populated for requests that fetch GitHub data like
    // Pulls.ListCommits, Repositories.ListCommits, etc.
    CommentCount *int `json:"comment_count,omitempty"`

    // SigningKey denotes a key to sign the commit with. If not nil this key will
    // be used to sign the commit. The private key must be present and already
    // decrypted. Ignored if Verification.Signature is defined.
    SigningKey *openpgp.Entity `json:"-"`
}

Commit represents a GitHub commit.

func (*Commit) GetAuthor Uses

func (c *Commit) GetAuthor() *CommitAuthor

GetAuthor returns the Author field.

func (*Commit) GetCommentCount Uses

func (c *Commit) GetCommentCount() int

GetCommentCount returns the CommentCount field if it's non-nil, zero value otherwise.

func (*Commit) GetCommitter Uses

func (c *Commit) GetCommitter() *CommitAuthor

GetCommitter returns the Committer field.

func (*Commit) GetHTMLURL Uses

func (c *Commit) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Commit) GetMessage Uses

func (c *Commit) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*Commit) GetNodeID Uses

func (c *Commit) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*Commit) GetSHA Uses

func (c *Commit) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*Commit) GetStats Uses

func (c *Commit) GetStats() *CommitStats

GetStats returns the Stats field.

func (*Commit) GetTree Uses

func (c *Commit) GetTree() *Tree

GetTree returns the Tree field.

func (*Commit) GetURL Uses

func (c *Commit) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Commit) GetVerification Uses

func (c *Commit) GetVerification() *SignatureVerification

GetVerification returns the Verification field.

func (Commit) String Uses

func (c Commit) String() string

type CommitAuthor Uses

type CommitAuthor struct {
    Date  *time.Time `json:"date,omitempty"`
    Name  *string    `json:"name,omitempty"`
    Email *string    `json:"email,omitempty"`

    // The following fields are only populated by Webhook events.
    Login *string `json:"username,omitempty"` // Renamed for go-github consistency.
}

CommitAuthor represents the author or committer of a commit. The commit author may not correspond to a GitHub User.

func (*CommitAuthor) GetDate Uses

func (c *CommitAuthor) GetDate() time.Time

GetDate returns the Date field if it's non-nil, zero value otherwise.

func (*CommitAuthor) GetEmail Uses

func (c *CommitAuthor) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*CommitAuthor) GetLogin Uses

func (c *CommitAuthor) GetLogin() string

GetLogin returns the Login field if it's non-nil, zero value otherwise.

func (*CommitAuthor) GetName Uses

func (c *CommitAuthor) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (CommitAuthor) String Uses

func (c CommitAuthor) String() string

type CommitCommentEvent Uses

type CommitCommentEvent struct {
    Comment *RepositoryComment `json:"comment,omitempty"`

    // The following fields are only populated by Webhook events.
    Action       *string       `json:"action,omitempty"`
    Repo         *Repository   `json:"repository,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

CommitCommentEvent is triggered when a commit comment is created. The Webhook event name is "commit_comment".

GitHub API docs: https://docs.github.com/en/rest/reference/activity/events/types/#commitcommentevent

func (*CommitCommentEvent) GetAction Uses

func (c *CommitCommentEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*CommitCommentEvent) GetComment Uses

func (c *CommitCommentEvent) GetComment() *RepositoryComment

GetComment returns the Comment field.

func (*CommitCommentEvent) GetInstallation Uses

func (c *CommitCommentEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*CommitCommentEvent) GetRepo Uses

func (c *CommitCommentEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*CommitCommentEvent) GetSender Uses

func (c *CommitCommentEvent) GetSender() *User

GetSender returns the Sender field.

type CommitFile Uses

type CommitFile struct {
    SHA              *string `json:"sha,omitempty"`
    Filename         *string `json:"filename,omitempty"`
    Additions        *int    `json:"additions,omitempty"`
    Deletions        *int    `json:"deletions,omitempty"`
    Changes          *int    `json:"changes,omitempty"`
    Status           *string `json:"status,omitempty"`
    Patch            *string `json:"patch,omitempty"`
    BlobURL          *string `json:"blob_url,omitempty"`
    RawURL           *string `json:"raw_url,omitempty"`
    ContentsURL      *string `json:"contents_url,omitempty"`
    PreviousFilename *string `json:"previous_filename,omitempty"`
}

CommitFile represents a file modified in a commit.

func (*CommitFile) GetAdditions Uses

func (c *CommitFile) GetAdditions() int

GetAdditions returns the Additions field if it's non-nil, zero value otherwise.

func (*CommitFile) GetBlobURL Uses

func (c *CommitFile) GetBlobURL() string

GetBlobURL returns the BlobURL field if it's non-nil, zero value otherwise.

func (*CommitFile) GetChanges Uses

func (c *CommitFile) GetChanges() int

GetChanges returns the Changes field if it's non-nil, zero value otherwise.

func (*CommitFile) GetContentsURL Uses

func (c *CommitFile) GetContentsURL() string

GetContentsURL returns the ContentsURL field if it's non-nil, zero value otherwise.

func (*CommitFile) GetDeletions Uses

func (c *CommitFile) GetDeletions() int

GetDeletions returns the Deletions field if it's non-nil, zero value otherwise.

func (*CommitFile) GetFilename Uses

func (c *CommitFile) GetFilename() string

GetFilename returns the Filename field if it's non-nil, zero value otherwise.

func (*CommitFile) GetPatch Uses

func (c *CommitFile) GetPatch() string

GetPatch returns the Patch field if it's non-nil, zero value otherwise.

func (*CommitFile) GetPreviousFilename Uses

func (c *CommitFile) GetPreviousFilename() string

GetPreviousFilename returns the PreviousFilename field if it's non-nil, zero value otherwise.

func (*CommitFile) GetRawURL Uses

func (c *CommitFile) GetRawURL() string

GetRawURL returns the RawURL field if it's non-nil, zero value otherwise.

func (*CommitFile) GetSHA Uses

func (c *CommitFile) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*CommitFile) GetStatus Uses

func (c *CommitFile) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (CommitFile) String Uses

func (c CommitFile) String() string

type CommitResult Uses

type CommitResult struct {
    SHA         *string   `json:"sha,omitempty"`
    Commit      *Commit   `json:"commit,omitempty"`
    Author      *User     `json:"author,omitempty"`
    Committer   *User     `json:"committer,omitempty"`
    Parents     []*Commit `json:"parents,omitempty"`
    HTMLURL     *string   `json:"html_url,omitempty"`
    URL         *string   `json:"url,omitempty"`
    CommentsURL *string   `json:"comments_url,omitempty"`

    Repository *Repository `json:"repository,omitempty"`
    Score      *float64    `json:"score,omitempty"`
}

CommitResult represents a commit object as returned in commit search endpoint response.

func (*CommitResult) GetAuthor Uses

func (c *CommitResult) GetAuthor() *User

GetAuthor returns the Author field.

func (*CommitResult) GetCommentsURL Uses

func (c *CommitResult) GetCommentsURL() string

GetCommentsURL returns the CommentsURL field if it's non-nil, zero value otherwise.

func (*CommitResult) GetCommit Uses

func (c *CommitResult) GetCommit() *Commit

GetCommit returns the Commit field.

func (*CommitResult) GetCommitter Uses

func (c *CommitResult) GetCommitter() *User

GetCommitter returns the Committer field.

func (*CommitResult) GetHTMLURL Uses

func (c *CommitResult) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*CommitResult) GetRepository Uses

func (c *CommitResult) GetRepository() *Repository

GetRepository returns the Repository field.

func (*CommitResult) GetSHA Uses

func (c *CommitResult) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*CommitResult) GetScore Uses

func (c *CommitResult) GetScore() *float64

GetScore returns the Score field.

func (*CommitResult) GetURL Uses

func (c *CommitResult) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type CommitStats Uses

type CommitStats struct {
    Additions *int `json:"additions,omitempty"`
    Deletions *int `json:"deletions,omitempty"`
    Total     *int `json:"total,omitempty"`
}

CommitStats represents the number of additions / deletions from a file in a given RepositoryCommit or GistCommit.

func (*CommitStats) GetAdditions Uses

func (c *CommitStats) GetAdditions() int

GetAdditions returns the Additions field if it's non-nil, zero value otherwise.

func (*CommitStats) GetDeletions Uses

func (c *CommitStats) GetDeletions() int

GetDeletions returns the Deletions field if it's non-nil, zero value otherwise.

func (*CommitStats) GetTotal Uses

func (c *CommitStats) GetTotal() int

GetTotal returns the Total field if it's non-nil, zero value otherwise.

func (CommitStats) String Uses

func (c CommitStats) String() string

type CommitsComparison Uses

type CommitsComparison struct {
    BaseCommit      *RepositoryCommit `json:"base_commit,omitempty"`
    MergeBaseCommit *RepositoryCommit `json:"merge_base_commit,omitempty"`

    // Head can be 'behind' or 'ahead'
    Status       *string `json:"status,omitempty"`
    AheadBy      *int    `json:"ahead_by,omitempty"`
    BehindBy     *int    `json:"behind_by,omitempty"`
    TotalCommits *int    `json:"total_commits,omitempty"`

    Commits []*RepositoryCommit `json:"commits,omitempty"`

    Files []*CommitFile `json:"files,omitempty"`

    HTMLURL      *string `json:"html_url,omitempty"`
    PermalinkURL *string `json:"permalink_url,omitempty"`
    DiffURL      *string `json:"diff_url,omitempty"`
    PatchURL     *string `json:"patch_url,omitempty"`
    URL          *string `json:"url,omitempty"` // API URL.
}

CommitsComparison is the result of comparing two commits. See CompareCommits() for details.

func (*CommitsComparison) GetAheadBy Uses

func (c *CommitsComparison) GetAheadBy() int

GetAheadBy returns the AheadBy field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetBaseCommit Uses

func (c *CommitsComparison) GetBaseCommit() *RepositoryCommit

GetBaseCommit returns the BaseCommit field.

func (*CommitsComparison) GetBehindBy Uses

func (c *CommitsComparison) GetBehindBy() int

GetBehindBy returns the BehindBy field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetDiffURL Uses

func (c *CommitsComparison) GetDiffURL() string

GetDiffURL returns the DiffURL field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetHTMLURL Uses

func (c *CommitsComparison) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetMergeBaseCommit Uses

func (c *CommitsComparison) GetMergeBaseCommit() *RepositoryCommit

GetMergeBaseCommit returns the MergeBaseCommit field.

func (*CommitsComparison) GetPatchURL Uses

func (c *CommitsComparison) GetPatchURL() string

GetPatchURL returns the PatchURL field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetPermalinkURL Uses

func (c *CommitsComparison) GetPermalinkURL() string

GetPermalinkURL returns the PermalinkURL field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetStatus Uses

func (c *CommitsComparison) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetTotalCommits Uses

func (c *CommitsComparison) GetTotalCommits() int

GetTotalCommits returns the TotalCommits field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetURL Uses

func (c *CommitsComparison) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (CommitsComparison) String Uses

func (c CommitsComparison) String() string

type CommitsListOptions Uses

type CommitsListOptions struct {
    // SHA or branch to start listing Commits from.
    SHA string `url:"sha,omitempty"`

    // Path that should be touched by the returned Commits.
    Path string `url:"path,omitempty"`

    // Author of by which to filter Commits.
    Author string `url:"author,omitempty"`

    // Since when should Commits be included in the response.
    Since time.Time `url:"since,omitempty"`

    // Until when should Commits be included in the response.
    Until time.Time `url:"until,omitempty"`

    ListOptions
}

CommitsListOptions specifies the optional parameters to the RepositoriesService.ListCommits method.

type CommitsSearchResult Uses

type CommitsSearchResult struct {
    Total             *int            `json:"total_count,omitempty"`
    IncompleteResults *bool           `json:"incomplete_results,omitempty"`
    Commits           []*CommitResult `json:"items,omitempty"`
}

CommitsSearchResult represents the result of a commits search.

func (*CommitsSearchResult) GetIncompleteResults Uses

func (c *CommitsSearchResult) GetIncompleteResults() bool

GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.

func (*CommitsSearchResult) GetTotal Uses

func (c *CommitsSearchResult) GetTotal() int

GetTotal returns the Total field if it's non-nil, zero value otherwise.

type CommunityHealthFiles Uses

type CommunityHealthFiles struct {
    CodeOfConduct       *Metric `json:"code_of_conduct"`
    Contributing        *Metric `json:"contributing"`
    IssueTemplate       *Metric `json:"issue_template"`
    PullRequestTemplate *Metric `json:"pull_request_template"`
    License             *Metric `json:"license"`
    Readme              *Metric `json:"readme"`
}

CommunityHealthFiles represents the different files in the community health metrics response.

func (*CommunityHealthFiles) GetCodeOfConduct Uses

func (c *CommunityHealthFiles) GetCodeOfConduct() *Metric

GetCodeOfConduct returns the CodeOfConduct field.

func (*CommunityHealthFiles) GetContributing Uses

func (c *CommunityHealthFiles) GetContributing() *Metric

GetContributing returns the Contributing field.

func (*CommunityHealthFiles) GetIssueTemplate Uses

func (c *CommunityHealthFiles) GetIssueTemplate() *Metric

GetIssueTemplate returns the IssueTemplate field.

func (*CommunityHealthFiles) GetLicense Uses

func (c *CommunityHealthFiles) GetLicense() *Metric

GetLicense returns the License field.

func (*CommunityHealthFiles) GetPullRequestTemplate Uses

func (c *CommunityHealthFiles) GetPullRequestTemplate() *Metric

GetPullRequestTemplate returns the PullRequestTemplate field.

func (*CommunityHealthFiles) GetReadme Uses

func (c *CommunityHealthFiles) GetReadme() *Metric

GetReadme returns the Readme field.

type CommunityHealthMetrics Uses

type CommunityHealthMetrics struct {
    HealthPercentage *int                  `json:"health_percentage"`
    Files            *CommunityHealthFiles `json:"files"`
    UpdatedAt        *time.Time            `json:"updated_at"`
}

CommunityHealthMetrics represents a response containing the community metrics of a repository.

func (*CommunityHealthMetrics) GetFiles Uses

func (c *CommunityHealthMetrics) GetFiles() *CommunityHealthFiles

GetFiles returns the Files field.

func (*CommunityHealthMetrics) GetHealthPercentage Uses

func (c *CommunityHealthMetrics) GetHealthPercentage() int

GetHealthPercentage returns the HealthPercentage field if it's non-nil, zero value otherwise.

func (*CommunityHealthMetrics) GetUpdatedAt Uses

func (c *CommunityHealthMetrics) GetUpdatedAt() time.Time

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

type ContentReference Uses

type ContentReference struct {
    ID        *int64  `json:"id,omitempty"`
    NodeID    *string `json:"node_id,omitempty"`
    Reference *string `json:"reference,omitempty"`
}

ContentReference represents a reference to a URL in an issue or pull request.

func (*ContentReference) GetID Uses

func (c *ContentReference) GetID() int64

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

func (*ContentReference) GetNodeID Uses

func (c *ContentReference) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*ContentReference) GetReference Uses

func (c *ContentReference) GetReference() string

GetReference returns the Reference field if it's non-nil, zero value otherwise.

type ContentReferenceEvent Uses

type ContentReferenceEvent struct {
    Action           *string           `json:"action,omitempty"`
    ContentReference *ContentReference `json:"content_reference,omitempty"`
    Repo             *Repository       `json:"repository,omitempty"`
    Sender           *User             `json:"sender,omitempty"`
    Installation     *Installation     `json:"installation,omitempty"`
}

ContentReferenceEvent is triggered when the body or comment of an issue or pull request includes a URL that matches a configured content reference domain. The Webhook event name is "content_reference".

GitHub API docs: https://developer.github.com/webhooks/event-payloads/#content_reference

func (*ContentReferenceEvent) GetAction Uses

func (c *ContentReferenceEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*ContentReferenceEvent) GetContentReference Uses

func (c *ContentReferenceEvent) GetContentReference() *ContentReference

GetContentReference returns the ContentReference field.

func (*ContentReferenceEvent) GetInstallation Uses

func (c *ContentReferenceEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*ContentReferenceEvent) GetRepo Uses

func (c *ContentReferenceEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*ContentReferenceEvent) GetSender Uses

func (c *ContentReferenceEvent) GetSender() *User

GetSender returns the Sender field.

type Contributor Uses

type Contributor struct {
    Login             *string `json:"login,omitempty"`
    ID                *int64  `json:"id,omitempty"`
    NodeID            *string `json:"node_id,omitempty"`
    AvatarURL         *string `json:"avatar_url,omitempty"`
    GravatarID        *string `json:"gravatar_id,omitempty"`
    URL               *string `json:"url,omitempty"`
    HTMLURL           *string `json:"html_url,omitempty"`
    FollowersURL      *string `json:"followers_url,omitempty"`
    FollowingURL      *string `json:"following_url,omitempty"`
    GistsURL          *string `json:"gists_url,omitempty"`
    StarredURL        *string `json:"starred_url,omitempty"`
    SubscriptionsURL  *string `json:"subscriptions_url,omitempty"`
    OrganizationsURL  *string `json:"organizations_url,omitempty"`
    ReposURL          *string `json:"repos_url,omitempty"`
    EventsURL         *string `json:"events_url,omitempty"`
    ReceivedEventsURL *string `json:"received_events_url,omitempty"`
    Type              *string `json:"type,omitempty"`
    SiteAdmin         *bool   `json:"site_admin,omitempty"`
    Contributions     *int    `json:"contributions,omitempty"`
}

Contributor represents a repository contributor

func (*Contributor) GetAvatarURL Uses

func (c *Contributor) GetAvatarURL() string

GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetContributions Uses

func (c *Contributor) GetContributions() int

GetContributions returns the Contributions field if it's non-nil, zero value otherwise.

func (*Contributor) GetEventsURL Uses

func (c *Contributor) GetEventsURL() string

GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetFollowersURL Uses

func (c *Contributor) GetFollowersURL() string

GetFollowersURL returns the FollowersURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetFollowingURL Uses

func (c *Contributor) GetFollowingURL() string

GetFollowingURL returns the FollowingURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetGistsURL Uses

func (c *Contributor) GetGistsURL() string

GetGistsURL returns the GistsURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetGravatarID Uses

func (c *Contributor) GetGravatarID() string

GetGravatarID returns the GravatarID field if it's non-nil, zero value otherwise.

func (*Contributor) GetHTMLURL Uses

func (c *Contributor) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetID Uses

func (c *Contributor) GetID() int64

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

func (*Contributor) GetLogin Uses

func (c *Contributor) GetLogin() string

GetLogin returns the Login field if it's non-nil, zero value otherwise.

func (*Contributor) GetNodeID Uses

func (c *Contributor) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*Contributor) GetOrganizationsURL Uses

func (c *Contributor) GetOrganizationsURL() string

GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetReceivedEventsURL Uses

func (c *Contributor) GetReceivedEventsURL() string

GetReceivedEventsURL returns the ReceivedEventsURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetReposURL Uses

func (c *Contributor) GetReposURL() string

GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetSiteAdmin Uses

func (c *Contributor) GetSiteAdmin() bool

GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise.

func (*Contributor) GetStarredURL Uses

func (c *Contributor) GetStarredURL() string

GetStarredURL returns the StarredURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetSubscriptionsURL Uses

func (c *Contributor) GetSubscriptionsURL() string

GetSubscriptionsURL returns the SubscriptionsURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetType Uses

func (c *Contributor) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Contributor) GetURL Uses

func (c *Contributor) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type ContributorStats Uses

type ContributorStats struct {
    Author *Contributor   `json:"author,omitempty"`
    Total  *int           `json:"total,omitempty"`
    Weeks  []*WeeklyStats `json:"weeks,omitempty"`
}

ContributorStats represents a contributor to a repository and their weekly contributions to a given repo.

func (*ContributorStats) GetAuthor Uses

func (c *ContributorStats) GetAuthor() *Contributor

GetAuthor returns the Author field.

func (*ContributorStats) GetTotal Uses

func (c *ContributorStats) GetTotal() int

GetTotal returns the Total field if it's non-nil, zero value otherwise.

func (ContributorStats) String Uses

func (c ContributorStats) String() string

type CreateCheckRunOptions Uses

type CreateCheckRunOptions struct {
    Name        string            `json:"name"`                   // The name of the check (e.g., "code-coverage"). (Required.)
    HeadSHA     string            `json:"head_sha"`               // The SHA of the commit. (Required.)
    DetailsURL  *string           `json:"details_url,omitempty"`  // The URL of the integrator's site that has the full details of the check. (Optional.)
    ExternalID  *string           `json:"external_id,omitempty"`  // A reference for the run on the integrator's system. (Optional.)
    Status      *string           `json:"status,omitempty"`       // The current status. Can be one of "queued", "in_progress", or "completed". Default: "queued". (Optional.)
    Conclusion  *string           `json:"conclusion,omitempty"`   // Can be one of "success", "failure", "neutral", "cancelled", "skipped", "timed_out", or "action_required". (Optional. Required if you provide a status of "completed".)
    StartedAt   *Timestamp        `json:"started_at,omitempty"`   // The time that the check run began. (Optional.)
    CompletedAt *Timestamp        `json:"completed_at,omitempty"` // The time the check completed. (Optional. Required if you provide conclusion.)
    Output      *CheckRunOutput   `json:"output,omitempty"`       // Provide descriptive details about the run. (Optional)
    Actions     []*CheckRunAction `json:"actions,omitempty"`      // Possible further actions the integrator can perform, which a user may trigger. (Optional.)
}

CreateCheckRunOptions sets up parameters needed to create a CheckRun.

func (*CreateCheckRunOptions) GetCompletedAt Uses

func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp

GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.

func (*CreateCheckRunOptions) GetConclusion Uses

func (c *CreateCheckRunOptions) GetConclusion() string

GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.

func (*CreateCheckRunOptions) GetDetailsURL Uses

func (c *CreateCheckRunOptions) GetDetailsURL() string

GetDetailsURL returns the DetailsURL field if it's non-nil, zero value otherwise.

func (*CreateCheckRunOptions) GetExternalID Uses

func (c *CreateCheckRunOptions) GetExternalID() string

GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise.

func (*CreateCheckRunOptions) GetOutput Uses

func (c *CreateCheckRunOptions) GetOutput() *CheckRunOutput

GetOutput returns the Output field.

func (*CreateCheckRunOptions) GetStartedAt Uses

func (c *CreateCheckRunOptions) GetStartedAt() Timestamp

GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.

func (*CreateCheckRunOptions) GetStatus Uses

func (c *CreateCheckRunOptions) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

type CreateCheckSuiteOptions Uses

type CreateCheckSuiteOptions struct {
    HeadSHA    string  `json:"head_sha"`              // The sha of the head commit. (Required.)
    HeadBranch *string `json:"head_branch,omitempty"` // The name of the head branch where the code changes are implemented.
}

CreateCheckSuiteOptions sets up parameters to manually create a check suites

func (*CreateCheckSuiteOptions) GetHeadBranch Uses

func (c *CreateCheckSuiteOptions) GetHeadBranch() string

GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise.

type CreateEvent Uses

type CreateEvent struct {
    Ref *string `json:"ref,omitempty"`
    // RefType is the object that was created. Possible values are: "repository", "branch", "tag".
    RefType      *string `json:"ref_type,omitempty"`
    MasterBranch *string `json:"master_branch,omitempty"`
    Description  *string `json:"description,omitempty"`

    // The following fields are only populated by Webhook events.
    PusherType   *string       `json:"pusher_type,omitempty"`
    Repo         *Repository   `json:"repository,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

CreateEvent represents a created repository, branch, or tag. The Webhook event name is "create".

Note: webhooks will not receive this event for created repositories. Additionally, webhooks will not receive this event for tags if more than three tags are pushed at once.

GitHub API docs: https://docs.github.com/en/rest/reference/activity/events/types/#createevent

func (*CreateEvent) GetDescription Uses

func (c *CreateEvent) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*CreateEvent) GetInstallation Uses

func (c *CreateEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*CreateEvent) GetMasterBranch Uses

func (c *CreateEvent) GetMasterBranch() string

GetMasterBranch returns the MasterBranch field if it's non-nil, zero value otherwise.

func (*CreateEvent) GetPusherType Uses

func (c *CreateEvent) GetPusherType() string

GetPusherType returns the PusherType field if it's non-nil, zero value otherwise.

func (*CreateEvent) GetRef Uses

func (c *CreateEvent) GetRef() string

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

func (*CreateEvent) GetRefType Uses

func (c *CreateEvent) GetRefType() string

GetRefType returns the RefType field if it's non-nil, zero value otherwise.

func (*CreateEvent) GetRepo Uses

func (c *CreateEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*CreateEvent) GetSender Uses

func (c *CreateEvent) GetSender() *User

GetSender returns the Sender field.

type CreateOrgInvitationOptions Uses

type CreateOrgInvitationOptions struct {
    // GitHub user ID for the person you are inviting. Not required if you provide Email.
    InviteeID *int64 `json:"invitee_id,omitempty"`
    // Email address of the person you are inviting, which can be an existing GitHub user.
    // Not required if you provide InviteeID
    Email *string `json:"email,omitempty"`
    // Specify role for new member. Can be one of:
    // * admin - Organization owners with full administrative rights to the
    // 	 organization and complete access to all repositories and teams.
    // * direct_member - Non-owner organization members with ability to see
    //   other members and join teams by invitation.
    // * billing_manager - Non-owner organization members with ability to
    //   manage the billing settings of your organization.
    // Default is "direct_member".
    Role   *string `json:"role"`
    TeamID []int64 `json:"team_ids"`
}

CreateOrgInvitationOptions specifies the parameters to the OrganizationService.Invite method.

func (*CreateOrgInvitationOptions) GetEmail Uses

func (c *CreateOrgInvitationOptions) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*CreateOrgInvitationOptions) GetInviteeID Uses

func (c *CreateOrgInvitationOptions) GetInviteeID() int64

GetInviteeID returns the InviteeID field if it's non-nil, zero value otherwise.

func (*CreateOrgInvitationOptions) GetRole Uses

func (c *CreateOrgInvitationOptions) GetRole() string

GetRole returns the Role field if it's non-nil, zero value otherwise.

type CreateUserProjectOptions Uses

type CreateUserProjectOptions struct {
    // The name of the project. (Required.)
    Name string `json:"name"`
    // The description of the project. (Optional.)
    Body *string `json:"body,omitempty"`
}

CreateUserProjectOptions specifies the parameters to the UsersService.CreateProject method.

func (*CreateUserProjectOptions) GetBody Uses

func (c *CreateUserProjectOptions) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

type CreateWorkflowDispatchEventRequest Uses

type CreateWorkflowDispatchEventRequest struct {
    // Ref represents the reference of the workflow run.
    // The reference can be a branch, tag, or a commit SHA.
    // Ref is required when creating a workflow dispatch event.
    Ref string `json:"ref"`
    // Inputs represents input keys and values configured in the workflow file.
    // The maximum number of properties is 10.
    // Default: Any default properties configured in the workflow file will be used when `inputs` are omitted.
    Inputs map[string]interface{} `json:"inputs,omitempty"`
}

CreateWorkflowDispatchEventRequest represents a request to create a workflow dispatch event.

type DeleteEvent Uses

type DeleteEvent struct {
    Ref *string `json:"ref,omitempty"`
    // RefType is the object that was deleted. Possible values are: "branch", "tag".
    RefType *string `json:"ref_type,omitempty"`

    // The following fields are only populated by Webhook events.
    PusherType   *string       `json:"pusher_type,omitempty"`
    Repo         *Repository   `json:"repository,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

DeleteEvent represents a deleted branch or tag. The Webhook event name is "delete".

Note: webhooks will not receive this event for tags if more than three tags are deleted at once.

GitHub API docs: https://docs.github.com/en/rest/reference/activity/events/types/#deleteevent

func (*DeleteEvent) GetInstallation Uses

func (d *DeleteEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*DeleteEvent) GetPusherType Uses

func (d *DeleteEvent) GetPusherType() string

GetPusherType returns the PusherType field if it's non-nil, zero value otherwise.

func (*DeleteEvent) GetRef Uses

func (d *DeleteEvent) GetRef() string

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

func (*DeleteEvent) GetRefType Uses

func (d *DeleteEvent) GetRefType() string

GetRefType returns the RefType field if it's non-nil, zero value otherwise.

func (*DeleteEvent) GetRepo Uses

func (d *DeleteEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*DeleteEvent) GetSender Uses

func (d *DeleteEvent) GetSender() *User

GetSender returns the Sender field.

type DeployKeyEvent Uses

type DeployKeyEvent struct {
    // Action is the action that was performed. Possible values are:
    // "created" or "deleted".
    Action *string `json:"action,omitempty"`

    // The deploy key resource.
    Key *Key `json:"key,omitempty"`
}

DeployKeyEvent is triggered when a deploy key is added or removed from a repository. The Webhook event name is "deploy_key".

GitHub API docs: https://docs.github.com/en/rest/reference/activity/events/types/#deploykeyevent

func (*DeployKeyEvent) GetAction Uses

func (d *DeployKeyEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*DeployKeyEvent) GetKey Uses

func (d *DeployKeyEvent) GetKey() *Key

GetKey returns the Key field.

type Deployment Uses

type Deployment struct {
    URL           *string         `json:"url,omitempty"`
    ID            *int64          `json:"id,omitempty"`
    SHA           *string         `json:"sha,omitempty"`
    Ref           *string         `json:"ref,omitempty"`
    Task          *string         `json:"task,omitempty"`
    Payload       json.RawMessage `json:"payload,omitempty"`
    Environment   *string         `json:"environment,omitempty"`
    Description   *string         `json:"description,omitempty"`
    Creator       *User           `json:"creator,omitempty"`
    CreatedAt     *Timestamp      `json:"created_at,omitempty"`
    UpdatedAt     *Timestamp      `json:"updated_at,omitempty"`
    StatusesURL   *string         `json:"statuses_url,omitempty"`
    RepositoryURL *string         `json:"repository_url,omitempty"`
    NodeID        *string         `json:"node_id,omitempty"`
}

Deployment represents a deployment in a repo

func (*Deployment) GetCreatedAt Uses

func (d *Deployment) GetCreatedAt() Timestamp

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

func (*Deployment) GetCreator Uses

func (d *Deployment) GetCreator() *User

GetCreator returns the Creator field.

func (*Deployment) GetDescription Uses

func (d *Deployment) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*Deployment) GetEnvironment Uses

func (d *Deployment) GetEnvironment() string

GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.

func (*Deployment) GetID Uses

func (d *Deployment) GetID() int64

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

func (*Deployment) GetNodeID Uses

func (d *Deployment) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*Deployment) GetRef Uses

func (d *Deployment) GetRef() string

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

func (*Deployment) GetRepositoryURL Uses

func (d *Deployment) GetRepositoryURL() string

GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.

func (*Deployment) GetSHA Uses

func (d *Deployment) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*Deployment) GetStatusesURL Uses

func (d *Deployment) GetStatusesURL() string

GetStatusesURL returns the StatusesURL field if it's non-nil, zero value otherwise.

func (*Deployment) GetTask Uses

func (d *Deployment) GetTask() string

GetTask returns the Task field if it's non-nil, zero value otherwise.

func (*Deployment) GetURL Uses

func (d *Deployment) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Deployment) GetUpdatedAt Uses

func (d *Deployment) GetUpdatedAt() Timestamp

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

type DeploymentEvent Uses

type DeploymentEvent struct {
    Deployment *Deployment `json:"deployment,omitempty"`
    Repo       *Repository `json:"repository,omitempty"`

    // The following fields are only populated by Webhook events.
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

DeploymentEvent represents a deployment. The Webhook event name is "deployment".

Events of this type are not visible in timelines, they are only used to trigger hooks.

GitHub API docs: https://docs.github.com/en/rest/reference/activity/events/types/#deploymentevent

func (*DeploymentEvent) GetDeployment Uses

func (d *DeploymentEvent) GetDeployment() *Deployment

GetDeployment returns the Deployment field.

func (*DeploymentEvent) GetInstallation Uses

func (d *DeploymentEvent) GetInstallation() *Installation

GetInstallation returns the Installation field.

func (*DeploymentEvent) GetRepo Uses

func (d *DeploymentEvent) GetRepo() *Repository

GetRepo returns the Repo field.

func (*DeploymentEvent) GetSender Uses

func (d *DeploymentEvent) GetSender() *User

GetSender returns the Sender field.

type DeploymentRequest Uses

type DeploymentRequest struct {
    Ref                   *string     `json:"ref,omitempty"`
    Task                  *string     `json:"task,omitempty"`
    AutoMerge             *bool       `json:"auto_merge,omitempty"`
    RequiredContexts      *[]string   `json:"required_contexts,omitempty"`
    Payload               interface{} `json:"payload,omitempty"`
    Environment           *string     `json:"environment,omitempty"`
    Description           *string     `json:"description,omitempty"`
    TransientEnvironment  *bool       `json:"transient_environment,omitempty"`
    ProductionEnvironment *bool       `json:"production_environment,omitempty"`
}

DeploymentRequest represents a deployment request

func (*DeploymentRequest) GetAutoMerge Uses

func (d *DeploymentRequest) GetAutoMerge() bool

GetAutoMerge returns the AutoMerge field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetDescription Uses

func (d *DeploymentRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetEnvironment Uses

func (d *DeploymentRequest) GetEnvironment() string

GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetProductionEnvironment Uses

func (d *DeploymentRequest) GetProductionEnvironment() bool

GetProductionEnvironment returns the ProductionEnvironment field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetRef Uses

func (d *DeploymentRequest) GetRef() string

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

func (*DeploymentRequest) GetRequiredContexts Uses

func (d *DeploymentRequest) GetRequiredContexts() []string

GetRequiredContexts returns the RequiredContexts field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetTask Uses

func (d *DeploymentRequest) GetTask() string

GetTask returns the Task field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetTransientEnvironment Uses

func (d *DeploymentRequest) GetTransientEnvironment() bool

GetTransientEnvironment returns the TransientEnvironment field if it's non-nil, zero value otherwise.

type DeploymentStatus Uses

type DeploymentStatus struct {
    ID  *int64 `json:"id,omitempty"`
    // State is the deployment state.
    // Possible values are: "pending", "success", "failure", "error",
    // "inactive", "in_progress", "queued".
    State          *string    `json:"state,omitempty"`
    Creator        *User      `json:"creator,omitempty"`
    Description    *string    `json:"description,omitempty"`
    Environment    *string    `json:"environment,omitempty"`
    NodeID         *string    `json:"node_id,omitempty"`
    CreatedAt      *Timestamp `json:"created_at,omitempty"`
    UpdatedAt      *Timestamp `json:"updated_at,omitempty"`
    TargetURL      *string    `json:"target_url,omitempty"`
    DeploymentURL  *string    `json:"deployment_url,omitempty"`
    RepositoryURL  *string    `json:"repository_url,omitempty"`
    EnvironmentURL *string    `json:"environment_url,omitempty"`
    LogURL         *string    `json:"log_url,omitempty"`
    URL            *string    `json:"url,omitempty"`
}

DeploymentStatus represents the status of a particular deployment.

func (*DeploymentStatus) GetCreatedAt Uses

func (d *DeploymentStatus) GetCreatedAt() Timestamp

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

func (*DeploymentStatus) GetCreator Uses

func (d *DeploymentStatus) GetCreator() *User

GetCreator returns the Creator field.

func (*DeploymentStatus) GetDeploymentURL Uses

func (d *DeploymentStatus) GetDeploymentURL() string

GetDeploymentURL returns the DeploymentURL field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetDescription Uses

func (d *DeploymentStatus) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetEnvironment Uses

func (d *DeploymentStatus) GetEnvironment() string

GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetEnvironmentURL Uses

func (d *DeploymentStatus) GetEnvironmentURL() string

GetEnvironmentURL returns the EnvironmentURL field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetID Uses

func (d *DeploymentStatus) GetID() int64

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

func (*DeploymentStatus) GetLogURL Uses

func (d *DeploymentStatus) GetLogURL() string

GetLogURL returns the LogURL field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetNodeID Uses

func (d *DeploymentStatus) GetNodeID() string

GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetRepositoryURL