Comprehensive documentation for additional GitHub API services including Activity, Search, Gists, Webhooks, Secrets, and more.
Track events, notifications, starring, and watching.
type ActivityService struct{}// ListEvents lists public events
func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error)
// ListRepositoryEvents lists events for a repository
func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error)
// ListUserReceivedEvents lists events received by a user
func (s *ActivityService) ListUserReceivedEvents(ctx context.Context, user string, opts *ListOptions) ([]*Event, *Response, error)
// ListUserEventsForOrganization lists user events for an organization
func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error)// ListStargazers lists stargazers of a repository
func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error)
// ListStarred lists repositories starred by a user
func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *ActivityListStarredOptions) ([]*StarredRepository, *Response, error)
// IsStarred checks if the authenticated user has starred a repository
func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error)
// Star a repository for the authenticated user
func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error)
// Unstar a repository for the authenticated user
func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error)// ListWatchers lists watchers of a repository
func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error)
// ListWatched lists repositories watched by a user
func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *ListOptions) ([]*Repository, *Response, error)
// GetRepositorySubscription gets the subscription for a repository
func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *Response, error)
// SetRepositorySubscription sets the subscription for a repository
func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error)
// DeleteRepositorySubscription deletes the subscription for a repository
func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error)// ListNotifications lists all notifications for the authenticated user
func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error)
// ListRepositoryNotifications lists notifications for a repository
func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error)
// GetThread gets a single notification thread
func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error)
// MarkThreadRead marks a notification thread as read
func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error)
// MarkNotificationsRead marks all notifications as read
func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead time.Time) (*Response, error)
// MarkRepositoryNotificationsRead marks repository notifications as read
func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead time.Time) (*Response, error)// ListFeeds lists available feeds for the authenticated user
func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error)
type Feeds struct {
TimelineURL *string
UserURL *string
CurrentUserURL *string
// Additional feed URLs
}Search repositories, code, issues, users, topics, commits, and labels.
type SearchService struct{}// Repositories searches for repositories
func (s *SearchService) Repositories(ctx context.Context, query string, opts *SearchOptions) (*RepositoriesSearchResult, *Response, error)
type RepositoriesSearchResult struct {
Total *int
IncompleteResults *bool
Repositories []*Repository
}// Code searches for code
func (s *SearchService) Code(ctx context.Context, query string, opts *SearchOptions) (*CodeSearchResult, *Response, error)
type CodeSearchResult struct {
Total *int
IncompleteResults *bool
CodeResults []*CodeResult
}
type CodeResult struct {
Name *string
Path *string
SHA *string
URL *string
GitURL *string
HTMLURL *string
Repository *Repository
}// Issues searches for issues and pull requests
func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error)
type IssuesSearchResult struct {
Total *int
IncompleteResults *bool
Issues []*Issue
}// Users searches for users
func (s *SearchService) Users(ctx context.Context, query string, opts *SearchOptions) (*UsersSearchResult, *Response, error)
type UsersSearchResult struct {
Total *int
IncompleteResults *bool
Users []*User
}// Topics searches for topics
func (s *SearchService) Topics(ctx context.Context, query string, opts *SearchOptions) (*TopicsSearchResult, *Response, error)
type TopicsSearchResult struct {
Total *int
IncompleteResults *bool
Topics []*TopicResult
}// Commits searches for commits
func (s *SearchService) Commits(ctx context.Context, query string, opts *SearchOptions) (*CommitsSearchResult, *Response, error)
type CommitsSearchResult struct {
Total *int
IncompleteResults *bool
Commits []*CommitResult
}// Labels searches for labels
func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opts *SearchOptions) (*LabelsSearchResult, *Response, error)
type LabelsSearchResult struct {
Total *int
IncompleteResults *bool
Labels []*LabelResult
}Create and manage Gists.
type GistsService struct{}// List lists gists for a user (use "" for authenticated user)
func (s *GistsService) List(ctx context.Context, user string, opts *GistListOptions) ([]*Gist, *Response, error)
// ListAll lists all public gists
func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error)
// ListStarred lists starred gists for authenticated user
func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error)
// Get fetches a single gist
func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error)
// GetRevision gets a specific revision of a gist
func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error)
type Gist struct {
ID *string
Description *string
Public *bool
Owner *User
Files map[GistFilename]GistFile
Comments *int
HTMLURL *string
GitPullURL *string
GitPushURL *string
CreatedAt *Timestamp
UpdatedAt *Timestamp
NodeID *string
}
type GistFile struct {
Size *int
Filename *string
Language *string
Type *string
RawURL *string
Content *string
}// Create creates a new gist
func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error)
// Edit updates a gist
func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error)
// Delete deletes a gist
func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error)// IsStarred checks if a gist is starred
func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error)
// Star stars a gist
func (s *GistsService) Star(ctx context.Context, id string) (*Response, error)
// Unstar unstars a gist
func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error)// Fork forks a gist
func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error)
// ListForks lists forks of a gist
func (s *GistsService) ListForks(ctx context.Context, id string, opts *GistListOptions) ([]*GistFork, *Response, error)// ListComments lists comments on a gist
func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *ListOptions) ([]*GistComment, *Response, error)
// GetComment gets a single gist comment
func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int64) (*GistComment, *Response, error)
// CreateComment creates a comment on a gist
func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error)
// EditComment edits a gist comment
func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int64, comment *GistComment) (*GistComment, *Response, error)
// DeleteComment deletes a gist comment
func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int64) (*Response, error)Access GitHub's license database.
type LicensesService struct{}
// List lists popular open source licenses
func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, error)
// Get gets a specific license
func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error)
type License struct {
Key *string
Name *string
URL *string
SPDXID *string
HTMLURL *string
Description *string
Implementation *string
Permissions []string
Conditions []string
Limitations []string
Body *string
}Add and remove emoji reactions on issues, pull requests, comments, and commits.
type ReactionsService struct{}// ListIssueReactions lists reactions for an issue
func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error)
// CreateIssueReaction creates a reaction for an issue
func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error)
// DeleteIssueReaction deletes a reaction from an issue
func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error)
type Reaction struct {
ID *int64
NodeID *string
User *User
Content *string // "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"
}// ListIssueCommentReactions lists reactions for an issue comment
func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, commentID int64, opts *ListOptions) ([]*Reaction, *Response, error)
// CreateIssueCommentReaction creates a reaction for an issue comment
func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, commentID int64, content string) (*Reaction, *Response, error)
// DeleteIssueCommentReaction deletes a reaction from an issue comment
func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error)// ListPullRequestCommentReactions lists reactions for a pull request review comment
func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, commentID int64, opts *ListOptions) ([]*Reaction, *Response, error)
// CreatePullRequestCommentReaction creates a reaction for a pull request review comment
func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID int64, content string) (*Reaction, *Response, error)
// DeletePullRequestCommentReaction deletes a reaction from a pull request review comment
func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error)// ListCommitCommentReactions lists reactions for a commit comment
func (s *ReactionsService) ListCommitCommentReactions(ctx context.Context, owner, repo string, commentID int64, opts *ListOptions) ([]*Reaction, *Response, error)
// CreateCommitCommentReaction creates a reaction for a commit comment
func (s *ReactionsService) CreateCommitCommentReaction(ctx context.Context, owner, repo string, commentID int64, content string) (*Reaction, *Response, error)
// DeleteCommitCommentReaction deletes a reaction from a commit comment
func (s *ReactionsService) DeleteCommitCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error)Manage project boards and cards.
type ProjectsService struct{}// GetProject gets a project
func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, *Response, error)
// UpdateProject updates a project
func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *ProjectOptions) (*Project, *Response, error)
// DeleteProject deletes a project
func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Response, error)
type Project struct {
ID *int64
URL *string
HTMLURL *string
ColumnsURL *string
OwnerURL *string
Name *string
Body *string
Number *int
State *string
CreatedAt *Timestamp
UpdatedAt *Timestamp
NodeID *string
Creator *User
}// ListProjectColumns lists columns for a project
func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int64, opts *ListOptions) ([]*ProjectColumn, *Response, error)
// GetProjectColumn gets a project column
func (s *ProjectsService) GetProjectColumn(ctx context.Context, id int64) (*ProjectColumn, *Response, error)
// CreateProjectColumn creates a project column
func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error)
// UpdateProjectColumn updates a project column
func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error)
// DeleteProjectColumn deletes a project column
func (s *ProjectsService) DeleteProjectColumn(ctx context.Context, columnID int64) (*Response, error)
// MoveProjectColumn moves a project column
func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnMoveOptions) (*Response, error)// ListProjectCards lists cards for a project column
func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, opts *ProjectCardListOptions) ([]*ProjectCard, *Response, error)
// GetProjectCard gets a project card
func (s *ProjectsService) GetProjectCard(ctx context.Context, cardID int64) (*ProjectCard, *Response, error)
// CreateProjectCard creates a project card
func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error)
// UpdateProjectCard updates a project card
func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error)
// DeleteProjectCard deletes a project card
func (s *ProjectsService) DeleteProjectCard(ctx context.Context, cardID int64) (*Response, error)
// MoveProjectCard moves a project card
func (s *ProjectsService) MoveProjectCard(ctx context.Context, cardID int64, opts *ProjectCardMoveOptions) (*Response, error)Manage repository migrations.
type MigrationService struct{}
// StartMigration starts a migration
func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opts *MigrationOptions) (*Migration, *Response, error)
// ListMigrations lists migrations for an organization
func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts *ListOptions) ([]*Migration, *Response, error)
// MigrationStatus gets the status of a migration
func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int64) (*Migration, *Response, error)
// MigrationArchiveURL gets the URL for a migration archive
func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (string, error)
// DeleteMigration deletes a migration
func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int64) (*Response, error)
// UnlockRepo unlocks a repository that was locked for migration
func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int64, repo string) (*Response, error)type BillingService struct{}
// GetActionsBillingOrg gets GitHub Actions billing for an organization
func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) (*ActionBilling, *Response, error)
// GetPackagesBillingOrg gets GitHub Packages billing for an organization
func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) (*PackageBilling, *Response, error)
// GetStorageBillingOrg gets shared storage billing for an organization
func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) (*StorageBilling, *Response, error)type CodespacesService struct{}
// ListInRepo lists codespaces in a repository
func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, opts *ListOptions) (*Codespaces, *Response, error)
// GetForUser gets a codespace for the authenticated user
func (s *CodespacesService) GetForUser(ctx context.Context, codespaceName string) (*Codespace, *Response, error)
// CreateForUser creates a codespace for the authenticated user
func (s *CodespacesService) CreateForUser(ctx context.Context, opts *CreateCodespaceOptions) (*Codespace, *Response, error)
// DeleteForUser deletes a codespace for the authenticated user
func (s *CodespacesService) DeleteForUser(ctx context.Context, codespaceName string) (*Response, error)type CopilotService struct{}
// GetCopilotBusiness gets Copilot for Business seat information for an organization
func (s *CopilotService) GetCopilotBusiness(ctx context.Context, org string) (*CopilotOrganizationDetails, *Response, error)
// AddCopilotTeams adds teams to the Copilot subscription for an organization
func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teams []string) (*CopilotSeatDetails, *Response, error)
// RemoveCopilotTeams removes teams from the Copilot subscription
func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teams []string) (*CopilotSeatDetails, *Response, error)type DependabotService struct{}
// ListRepoAlerts lists Dependabot alerts for a repository
func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error)
// GetRepoAlert gets a single Dependabot alert
func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string, number int) (*DependabotAlert, *Response, error)
// UpdateRepoAlert updates a Dependabot alert
func (s *DependabotService) UpdateRepoAlert(ctx context.Context, owner, repo string, number int, opts *DependabotAlertUpdateOptions) (*DependabotAlert, *Response, error)type CodeScanningService struct{}
// ListAlertsForRepo lists code scanning alerts for a repository
func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error)
// GetAlert gets a single code scanning alert
func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error)
// UpdateAlert updates a code scanning alert
func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, opts *AlertUpdateOptions) (*Alert, *Response, error)
// UploadSarif uploads SARIF data containing analysis results
func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifUpload) (*SarifID, *Response, error)type SecretScanningService struct{}
// ListAlertsForRepo lists secret scanning alerts for a repository
func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error)
// GetAlert gets a single secret scanning alert
func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string, number int64) (*SecretScanningAlert, *Response, error)
// UpdateAlert updates a secret scanning alert
func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *SecretScanningAlertUpdateOptions) (*SecretScanningAlert, *Response, error)