Repository¶
-
class
github.Repository.
Repository
¶ This class represents Repositories.
The reference can be found here https://docs.github.com/en/rest/reference/repos
-
property
allow_auto_merge
¶ - Type
bool
-
property
allow_forking
¶ - Type
bool
-
property
allow_merge_commit
¶ - Type
bool
-
property
allow_rebase_merge
¶ - Type
bool
-
property
allow_squash_merge
¶ - Type
bool
-
property
allow_update_branch
¶ - Type
bool
-
property
archived
¶ - Type
bool
-
property
archive_url
¶ - Type
string
-
property
assignees_url
¶ - Type
string
-
property
blobs_url
¶ - Type
string
-
property
branches_url
¶ - Type
string
-
property
clone_url
¶ - Type
string
-
property
collaborators_url
¶ - Type
string
-
property
comments_url
¶ - Type
string
-
property
commits_url
¶ - Type
string
-
property
compare_url
¶ - Type
string
-
property
contents_url
¶ - Type
string
-
property
contributors_url
¶ - Type
string
-
property
created_at
¶ - Type
datetime
-
property
custom_properties
¶ - Type
dict[str, None | str | list]
-
property
default_branch
¶ - Type
string
-
property
delete_branch_on_merge
¶ - Type
bool
-
property
deployments_url
¶ - Type
string
-
property
description
¶ - Type
string
-
property
downloads_url
¶ - Type
string
-
property
events_url
¶ - Type
string
-
property
fork
¶ - Type
bool
-
property
forks
¶ - Type
integer
-
property
forks_count
¶ - Type
integer
-
property
forks_url
¶ - Type
string
-
property
full_name
¶ - Type
string
-
property
git_commits_url
¶ - Type
string
-
property
git_refs_url
¶ - Type
string
- Type
string
-
property
git_url
¶ - Type
string
-
property
has_downloads
¶ - Type
bool
-
property
has_issues
¶ - Type
bool
-
property
has_pages
¶ - Type
bool
-
property
has_projects
¶ - Type
bool
-
property
has_wiki
¶ - Type
bool
-
property
has_discussions
¶ - Type
bool
-
property
homepage
¶ - Type
string
-
property
hooks_url
¶ - Type
string
-
property
html_url
¶ - Type
string
-
property
id
¶ - Type
integer
-
property
is_template
¶ - Type
bool
-
property
issue_comment_url
¶ - Type
string
-
property
issue_events_url
¶ - Type
string
-
property
issues_url
¶ - Type
string
-
property
keys_url
¶ - Type
string
-
property
labels_url
¶ - Type
string
-
property
language
¶ - Type
string
-
property
languages_url
¶ - Type
string
-
property
merge_commit_message
¶ - Type
string
-
property
merge_commit_title
¶ - Type
string
-
property
merges_url
¶ - Type
string
-
property
milestones_url
¶ - Type
string
-
property
mirror_url
¶ - Type
string
-
property
name
¶ - Type
string
-
property
network_count
¶ - Type
integer
-
property
notifications_url
¶ - Type
string
-
property
open_issues
¶ - Type
integer
-
property
open_issues_count
¶ - Type
integer
-
property
organization
¶
-
property
owner
¶
-
property
parent
¶
-
property
permissions
¶
-
property
private
¶ - Type
bool
-
property
pulls_url
¶ - Type
string
-
property
pushed_at
¶ - Type
datetime
-
property
releases_url
¶ - Type
string
-
property
security_and_analysis
¶
-
property
size
¶ - Type
integer
-
property
source
¶
-
property
squash_merge_commit_message
¶ - Type
string
-
property
squash_merge_commit_title
¶ - Type
string
-
property
ssh_url
¶ - Type
string
-
property
stargazers_count
¶ - Type
integer
-
property
stargazers_url
¶ - Type
string
-
property
statuses_url
¶ - Type
string
-
property
subscribers_url
¶ - Type
string
-
property
subscribers_count
¶ - Type
integer
-
property
subscription_url
¶ - Type
string
-
property
svn_url
¶ - Type
string
- Type
string
-
property
teams_url
¶ - Type
string
-
property
topics
¶ - Type
list of strings
-
property
trees_url
¶ - Type
string
-
property
updated_at
¶ - Type
datetime
-
property
web_commit_signoff_required
¶ - Type
bool
-
add_to_collaborators
(collaborator: str | NamedUser, permission: Opt[str] = NotSet) → Invitation | None¶ - Calls
- Parameters
collaborator – string or
github.NamedUser.NamedUser
permission – string ‘pull’, ‘push’, ‘admin’, ‘maintain’, ‘triage’, or a custom repository role name, if the owning organization has defined any
- Return type
None
-
get_collaborator_permission
(collaborator: str | NamedUser) → str¶ - Calls
GET /repos/{owner}/{repo}/collaborators/{username}/permission
- Parameters
collaborator – string or
github.NamedUser.NamedUser
- Return type
string
-
get_pending_invitations
() → PaginatedList[Invitation]¶ - Calls
- Return type
PaginatedList
ofgithub.Invitation.Invitation
-
remove_invitation
(invite_id: int) → None¶ - Calls
- Return type
None
-
compare
(base: str, head: str) → Comparison¶ - Calls
- Parameters
base – string
head – string
- Return type
-
create_autolink
(key_prefix: str, url_template: str, is_alphanumeric: Union[bool, github.GithubObject._NotSetType] = NotSet) → github.Autolink.Autolink¶ - Calls
- Parameters
key_prefix – string
url_template – string
is_alphanumeric – bool
- Return type
-
create_git_blob
(content: str, encoding: str) → GitBlob¶ - Calls
- Parameters
content – string
encoding – string
- Return type
-
create_git_commit
(message: str, tree: GitTree, parents: list[GitCommit], author: Opt[InputGitAuthor] = NotSet, committer: Opt[InputGitAuthor] = NotSet) → GitCommit¶ - Calls
- Parameters
message – string
tree –
github.GitTree.GitTree
parents – list of
github.GitCommit.GitCommit
author –
github.InputGitAuthor.InputGitAuthor
committer –
github.InputGitAuthor.InputGitAuthor
- Return type
-
create_git_ref
(ref: str, sha: str) → GitRef¶ - Calls
- Parameters
ref – string
sha – string
- Return type
-
create_git_tag_and_release
(tag: str, tag_message: str, release_name: Opt[str], release_message: Opt[str], object: str, type: str, tagger: Opt[InputGitAuthor] = NotSet, draft: bool = False, prerelease: bool = False, generate_release_notes: bool = False) → GitRelease¶ Convenience function that calls
Repository.create_git_tag()
andRepository.create_git_release()
.- Parameters
tag – string
tag_message – string
release_name – string
release_message – string
object – string
type – string
tagger – :class:github.InputGitAuthor.InputGitAuthor
draft – bool
prerelease – bool
generate_release_notes – bool
- Return type
-
create_git_release
(tag: str, name: Opt[str] = NotSet, message: Opt[str] = NotSet, draft: bool = False, prerelease: bool = False, generate_release_notes: bool = False, target_commitish: Opt[str] = NotSet) → GitRelease¶ - Calls
- Parameters
tag – string
name – string
message – string
draft – bool
prerelease – bool
generate_release_notes – bool
target_commitish – string or
github.Branch.Branch
orgithub.Commit.Commit
orgithub.GitCommit.GitCommit
- Return type
-
create_git_tag
(tag: str, message: str, object: str, type: str, tagger: Opt[InputGitAuthor] = NotSet) → GitTag¶
-
create_git_tree
(tree: list[InputGitTreeElement], base_tree: Opt[GitTree] = NotSet) → GitTree¶ - Calls
- Parameters
tree – list of
github.InputGitTreeElement.InputGitTreeElement
base_tree –
github.GitTree.GitTree
- Return type
-
create_hook
(name: str, config: dict[str, str], events: Opt[list[str]] = NotSet, active: Opt[bool] = NotSet) → Hook¶ - Calls
- Parameters
name – string
config – dict
events – list of string
active – bool
- Return type
-
create_issue
(title: str, body: Opt[str] = NotSet, assignee: NamedUser | Opt[str] = NotSet, milestone: Opt[Milestone] = NotSet, labels: list[Label] | Opt[list[str]] = NotSet, assignees: Opt[list[str]] | list[NamedUser] = NotSet) → Issue¶ - Calls
- Parameters
title – string
body – string
assignee – string or
github.NamedUser.NamedUser
assignees – list of string or
github.NamedUser.NamedUser
milestone –
github.Milestone.Milestone
labels – list of
github.Label.Label
- Return type
-
create_key
(title: str, key: str, read_only: bool = False) → RepositoryKey¶ - Calls
- Parameters
title – string
key – string
read_only – bool
- Return type
-
create_label
(name: str, color: str, description: Opt[str] = NotSet) → Label¶ - Calls
- Parameters
name – string
color – string
description – string
- Return type
-
create_milestone
(title: str, state: Opt[str] = NotSet, description: Opt[str] = NotSet, due_on: Opt[date] = NotSet) → Milestone¶ - Calls
- Parameters
title – string
state – string
description – string
due_on – datetime
- Return type
-
create_project
(name: str, body: Opt[str] = NotSet) → Project¶ - Calls
- Parameters
name – string
body – string
- Return type
-
create_pull
(base: str, head: str, *, title: Union[str, github.GithubObject._NotSetType] = NotSet, body: Union[str, github.GithubObject._NotSetType] = NotSet, maintainer_can_modify: Union[bool, github.GithubObject._NotSetType] = NotSet, draft: Union[bool, github.GithubObject._NotSetType] = NotSet, issue: Union[github.Issue.Issue, github.GithubObject._NotSetType] = NotSet) → github.PullRequest.PullRequest¶
-
create_repository_advisory
(summary: str, description: str, severity_or_cvss_vector_string: str, cve_id: str | None = None, vulnerabilities: Iterable[github.AdvisoryVulnerability.AdvisoryVulnerabilityInput] | None = None, cwe_ids: Iterable[str] | None = None, credits: Iterable[github.AdvisoryCredit.AdvisoryCredit] | None = None) → github.RepositoryAdvisory.RepositoryAdvisory¶ - Calls
- Parameters
summary – string
description – string
severity_or_cvss_vector_string – string
cve_id – string
vulnerabilities – iterable of
github.AdvisoryVulnerability.AdvisoryVulnerabilityInput
cwe_ids – iterable of string
credits – iterable of
github.AdvisoryCredit.AdvisoryCredit
- Return type
-
report_security_vulnerability
(summary: str, description: str, severity_or_cvss_vector_string: str, cve_id: str | None = None, vulnerabilities: Iterable[github.AdvisoryVulnerability.AdvisoryVulnerabilityInput] | None = None, cwe_ids: Iterable[str] | None = None, credits: Iterable[github.AdvisoryCredit.AdvisoryCredit] | None = None) → github.RepositoryAdvisory.RepositoryAdvisory¶ - Calls
- Parameters
summary – string
description – string
severity_or_cvss_vector_string – string
cve_id – string
vulnerabilities – iterable of
github.AdvisoryVulnerability.AdvisoryVulnerabilityInput
cwe_ids – iterable of string
credits – iterable of
github.AdvisoryCredit.AdvisoryCredit
- Return type
-
create_repository_dispatch
(event_type: str, client_payload: Opt[dict[str, Any]] = NotSet) → bool¶ - Calls
POST /repos/{owner}/{repo}/dispatches <https://docs.github.com/en/rest/repos#create-a-repository-dispatch-event>
- Parameters
event_type – string
client_payload – dict
- Return type
bool
-
create_secret
(secret_name: str, unencrypted_value: str, secret_type: str = 'actions') → github.Secret.Secret¶ - Calls
PUT /repos/{owner}/{repo}/{secret_type}/secrets/{secret_name}
- Parameters
secret_type – string options actions or dependabot
-
get_secrets
(secret_type: str = 'actions') → github.PaginatedList.PaginatedList[github.Secret.Secret][github.Secret.Secret]¶ Gets all repository secrets :param secret_type: string options actions or dependabot.
-
get_secret
(secret_name: str, secret_type: str = 'actions') → github.Secret.Secret¶ - Calls
‘GET /repos/{owner}/{repo}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#get-an-organization-secret>`_
- Parameters
secret_type – string options actions or dependabot
-
create_variable
(variable_name: str, value: str) → github.Variable.Variable¶
-
get_variables
() → github.PaginatedList.PaginatedList[github.Variable.Variable][github.Variable.Variable]¶ Gets all repository variables :rtype:
PaginatedList
ofgithub.Variable.Variable
-
get_variable
(variable_name: str) → github.Variable.Variable¶ - Calls
‘GET /orgs/{org}/actions/variables/{variable_name} <https://docs.github.com/en/rest/actions/variables#get-an-organization-variable>`_
- Parameters
variable_name – string
- Return type
-
delete_secret
(secret_name: str, secret_type: str = 'actions') → bool¶ - Calls
DELETE /repos/{owner}/{repo}/{secret_type}/secrets/{secret_name}
- Parameters
secret_name – string
secret_type – string options actions or dependabot
- Return type
bool
-
delete_variable
(variable_name: str) → bool¶ - Calls
DELETE /repos/{owner}/{repo}/actions/variables/{variable_name}
- Parameters
variable_name – string
- Return type
bool
-
create_source_import
(vcs: str, vcs_url: str, vcs_username: Opt[str] = NotSet, vcs_password: Opt[str] = NotSet) → SourceImport¶ - Calls
- Parameters
vcs – string
vcs_url – string
vcs_username – string
vcs_password – string
- Return type
-
delete
() → None¶ - Calls
- Return type
None
-
edit
(name: str | None = None, description: Opt[str] = NotSet, homepage: Opt[str] = NotSet, private: Opt[bool] = NotSet, visibility: Opt[str] = NotSet, has_issues: Opt[bool] = NotSet, has_projects: Opt[bool] = NotSet, has_wiki: Opt[bool] = NotSet, has_discussions: Opt[bool] = NotSet, is_template: Opt[bool] = NotSet, default_branch: Opt[str] = NotSet, allow_squash_merge: Opt[bool] = NotSet, allow_merge_commit: Opt[bool] = NotSet, allow_rebase_merge: Opt[bool] = NotSet, allow_auto_merge: Opt[bool] = NotSet, delete_branch_on_merge: Opt[bool] = NotSet, allow_update_branch: Opt[bool] = NotSet, use_squash_pr_title_as_default: Opt[bool] = NotSet, squash_merge_commit_title: Opt[str] = NotSet, squash_merge_commit_message: Opt[str] = NotSet, merge_commit_title: Opt[str] = NotSet, merge_commit_message: Opt[str] = NotSet, archived: Opt[bool] = NotSet, allow_forking: Opt[bool] = NotSet, web_commit_signoff_required: Opt[bool] = NotSet) → None¶
-
get_archive_link
(archive_format: str, ref: Union[str, github.GithubObject._NotSetType] = NotSet) → str¶ - Calls
- Parameters
archive_format – string
ref – string
- Return type
string
-
get_assignees
() → PaginatedList[NamedUser]¶ - Calls
- Return type
PaginatedList
ofgithub.NamedUser.NamedUser
-
get_branch
(branch: str) → Branch¶ - Calls
- Parameters
branch – string
- Return type
-
rename_branch
(branch: str | Branch, new_name: str) → bool¶ - Calls
- Parameters
branch –
github.Branch.Branch
or stringnew_name – string
- Return type
bool
NOTE: This method does not return the branch since it may take some time to fully complete server-side.
-
get_branches
() → PaginatedList[Branch]¶ - Calls
- Return type
PaginatedList
ofgithub.Branch.Branch
-
get_collaborators
(affiliation: Opt[str] = NotSet, permission: Opt[str] = NotSet) → PaginatedList[NamedUser]¶ - Calls
- Parameters
affiliation – string
permission – string
- Return type
PaginatedList
ofgithub.NamedUser.NamedUser
-
get_comment
(id: int) → CommitComment¶ - Calls
- Parameters
id – integer
- Return type
-
get_comments
() → PaginatedList[CommitComment]¶ - Calls
- Return type
PaginatedList
ofgithub.CommitComment.CommitComment
-
get_commit
(sha: str) → Commit¶ - Calls
- Parameters
sha – string
- Return type
-
get_commits
(sha: Opt[str] = NotSet, path: Opt[str] = NotSet, since: Opt[datetime] = NotSet, until: Opt[datetime] = NotSet, author: Opt[AuthenticatedUser | NamedUser | str] = NotSet) → PaginatedList[Commit]¶ - Calls
- Parameters
sha – string
path – string
since – datetime
until – datetime
author – string or
github.NamedUser.NamedUser
orgithub.AuthenticatedUser.AuthenticatedUser
- Return type
PaginatedList
ofgithub.Commit.Commit
-
get_contents
(path: str, ref: Opt[str] = NotSet) → list[ContentFile] | ContentFile¶ - Calls
- Parameters
path – string
ref – string
- Return type
github.ContentFile.ContentFile
or a list of them
-
get_deployments
(sha: Opt[str] = NotSet, ref: Opt[str] = NotSet, task: Opt[str] = NotSet, environment: Opt[str] = NotSet) → PaginatedList[Deployment]¶ - Calls
- Param
sha: string
- Param
ref: string
- Param
task: string
- Param
environment: string
- Return type
PaginatedList
ofgithub.Deployment.Deployment
-
create_deployment
(ref: str, task: Opt[str] = NotSet, auto_merge: Opt[bool] = NotSet, required_contexts: Opt[list[str]] = NotSet, payload: Opt[dict[str, Any]] = NotSet, environment: Opt[str] = NotSet, description: Opt[str] = NotSet, transient_environment: Opt[bool] = NotSet, production_environment: Opt[bool] = NotSet) → Deployment¶ - Calls
- Param
ref: string
- Param
task: string
- Param
auto_merge: bool
- Param
required_contexts: list of status contexts
- Param
payload: dict
- Param
environment: string
- Param
description: string
- Param
transient_environment: bool
- Param
production_environment: bool
- Return type
-
get_top_referrers
() → None | list[Referrer]¶
-
get_top_paths
() → None | list[Path]¶ - Calls
- Return type
list
ofgithub.Path.Path
-
get_views_traffic
(per: Opt[str] = NotSet) → None | dict[str, int | list[View]]¶ - Calls
- Parameters
per – string, must be one of day or week, day by default
-
get_clones_traffic
(per: Opt[str] = NotSet) → dict[str, int | list[Clones]] | None¶ - Calls
- Parameters
per – string, must be one of day or week, day by default
- Return type
None or list of
github.Clones.Clones
-
get_projects
(state: Opt[str] = NotSet) → PaginatedList[Project]¶ - Calls
- Return type
PaginatedList
ofgithub.Project.Project
- Parameters
state – string
-
get_autolinks
() → PaginatedList[Autolink]¶ - Calls
- Return type
PaginatedList
ofgithub.Autolink.Autolink
-
create_file
(path: str, message: str, content: str | bytes, branch: Opt[str] = NotSet, committer: Opt[InputGitAuthor] = NotSet, author: Opt[InputGitAuthor] = NotSet) → dict[str, ContentFile | Commit]¶ Create a file in this repository.
- Calls
`PUT /repos/{owner}/{repo}/contents/{path} <https://docs.github.com/en/rest/reference/repos#create-or-
update-file-contents>`_ :param path: string, (required), path of the file in the repository :param message: string, (required), commit message :param content: string, (required), the actual data in the file :param branch: string, (optional), branch to create the commit on. Defaults to the default branch of the
repository
- Parameters
committer – InputGitAuthor, (optional), if no information is given the authenticated user’s information will be used. You must specify both a name and email.
author – InputGitAuthor, (optional), if omitted this will be filled in with committer information. If passed, you must specify both a name and email.
- Return type
{ ‘content’:
ContentFile
:, ‘commit’:Commit
}
-
get_repository_advisories
() → github.PaginatedList.PaginatedList[github.RepositoryAdvisory.RepositoryAdvisory][github.RepositoryAdvisory.RepositoryAdvisory]¶ - Calls
- Return type
PaginatedList
ofgithub.RepositoryAdvisory.RepositoryAdvisory
-
get_repository_advisory
(ghsa: str) → github.RepositoryAdvisory.RepositoryAdvisory¶ - Calls
- Parameters
ghsa – string
- Return type
-
update_file
(path: str, message: str, content: bytes | str, sha: str, branch: Opt[str] = NotSet, committer: Opt[InputGitAuthor] = NotSet, author: Opt[InputGitAuthor] = NotSet) → dict[str, ContentFile | Commit]¶ This method updates a file in a repository.
- Calls
`PUT /repos/{owner}/{repo}/contents/{path} <https://docs.github.com/en/rest/reference/repos#create-or-
update-file-contents>`_ :param path: string, Required. The content path. :param message: string, Required. The commit message. :param content: string, Required. The updated file content, either base64 encoded, or ready to be encoded. :param sha: string, Required. The blob SHA of the file being replaced. :param branch: string. The branch name. Default: the repository’s default branch (usually master) :param committer: InputGitAuthor, (optional), if no information is given the authenticated user’s information
will be used. You must specify both a name and email.
- Parameters
author – InputGitAuthor, (optional), if omitted this will be filled in with committer information. If passed, you must specify both a name and email.
- Return type
{ ‘content’:
ContentFile
:, ‘commit’:Commit
}
-
delete_file
(path: str, message: str, sha: str, branch: Opt[str] = NotSet, committer: Opt[InputGitAuthor] = NotSet, author: Opt[InputGitAuthor] = NotSet) → dict[str, Commit | _NotSetType]¶ This method deletes a file in a repository.
- Calls
`DELETE /repos/{owner}/{repo}/contents/{path} <https://docs.github.com/en/rest/reference/repos#delete-a-
file>`_ :param path: string, Required. The content path. :param message: string, Required. The commit message. :param sha: string, Required. The blob SHA of the file being replaced. :param branch: string. The branch name. Default: the repository’s default branch (usually master) :param committer: InputGitAuthor, (optional), if no information is given the authenticated user’s information
will be used. You must specify both a name and email.
- Parameters
author – InputGitAuthor, (optional), if omitted this will be filled in with committer information. If passed, you must specify both a name and email.
- Return type
{ ‘content’:
null
:, ‘commit’:Commit
}
-
get_dir_contents
(path: str, ref: Opt[str] = NotSet) → list[ContentFile]¶
-
get_contributors
(anon: Opt[str] = NotSet) → PaginatedList[NamedUser]¶ - Calls
- Parameters
anon – string
- Return type
PaginatedList
ofgithub.NamedUser.NamedUser
-
get_download
(id: int) → Download¶ - Calls
- Parameters
id – integer
- Return type
-
get_downloads
() → PaginatedList[Download]¶ - Calls
- Return type
PaginatedList
ofgithub.Download.Download
-
get_events
() → PaginatedList[Event]¶ - Calls
- Return type
PaginatedList
ofgithub.Event.Event
-
get_forks
() → github.PaginatedList.PaginatedList[github.Repository.Repository][github.Repository.Repository]¶ - Calls
- Return type
PaginatedList
ofgithub.Repository.Repository
-
create_fork
(organization: Organization | Opt[str] = NotSet, name: Opt[str] = NotSet, default_branch_only: Opt[bool] = NotSet) → Repository¶ - Calls
- Parameters
organization –
github.Organization.Organization
or stringname – string
default_branch_only – bool
- Return type
-
get_git_blob
(sha: str) → GitBlob¶ - Calls
- Parameters
sha – string
- Return type
-
get_git_commit
(sha: str) → GitCommit¶ - Calls
- Parameters
sha – string
- Return type
-
get_git_ref
(ref: str) → GitRef¶ - Calls
- Parameters
ref – string
- Return type
-
get_git_refs
() → PaginatedList[GitRef]¶ - Calls
- Return type
PaginatedList
ofgithub.GitRef.GitRef
-
get_git_matching_refs
(ref: str) → PaginatedList[GitRef]¶ - Calls
- Return type
PaginatedList
ofgithub.GitRef.GitRef
-
get_git_tag
(sha: str) → GitTag¶ - Calls
- Parameters
sha – string
- Return type
-
get_git_tree
(sha: str, recursive: Opt[bool] = NotSet) → GitTree¶ - Calls
- Parameters
sha – string
recursive – bool
- Return type
-
get_hook
(id: int) → Hook¶ - Calls
- Parameters
id – integer
- Return type
-
get_hooks
() → PaginatedList[Hook]¶ - Calls
- Return type
PaginatedList
ofgithub.Hook.Hook
-
get_hook_delivery
(hook_id: int, delivery_id: int) → github.HookDelivery.HookDelivery¶ - Calls
GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}
- Parameters
hook_id – integer
delivery_id – integer
- Return type
-
get_hook_deliveries
(hook_id: int) → github.PaginatedList.PaginatedList[github.HookDelivery.HookDeliverySummary][github.HookDelivery.HookDeliverySummary]¶ - Calls
- Parameters
hook_id – integer
- Return type
PaginatedList
ofgithub.HookDelivery.HookDeliverySummary
-
get_issue
(number: int) → Issue¶ - Calls
- Parameters
number – integer
- Return type
-
get_issues
(milestone: Milestone | Opt[str] = NotSet, state: Opt[str] = NotSet, assignee: NamedUser | Opt[str] = NotSet, mentioned: Opt[NamedUser] = NotSet, labels: Opt[list[str] | list[Label]] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet, since: Opt[datetime] = NotSet, creator: Opt[NamedUser] = NotSet) → PaginatedList[Issue]¶ - Calls
- Parameters
milestone –
github.Milestone.Milestone
or “none” or “*”state – string. open, closed, or all. If this is not set the GitHub API default behavior will be used. At the moment this is to return only open issues. This might change anytime on GitHub API side and it could be clever to explicitly specify the state value.
assignee – string or
github.NamedUser.NamedUser
or “none” or “*”mentioned –
github.NamedUser.NamedUser
labels – list of string or
github.Label.Label
sort – string
direction – string
since – datetime
creator – string or
github.NamedUser.NamedUser
- Return type
PaginatedList
ofgithub.Issue.Issue
-
get_issues_comments
(sort: Opt[str] = NotSet, direction: Opt[str] = NotSet, since: Opt[datetime] = NotSet) → PaginatedList[IssueComment]¶ - Calls
- Parameters
sort – string
direction – string
since – datetime
- Return type
PaginatedList
ofgithub.IssueComment.IssueComment
-
get_issues_event
(id: int) → IssueEvent¶ - Calls
- Parameters
id – integer
- Return type
-
get_issues_events
() → PaginatedList[IssueEvent]¶ - Calls
- Return type
PaginatedList
ofgithub.IssueEvent.IssueEvent
-
get_key
(id: int) → RepositoryKey¶ - Calls
- Parameters
id – integer
- Return type
-
get_keys
() → PaginatedList[RepositoryKey]¶ - Calls
- Return type
PaginatedList
ofgithub.RepositoryKey.RepositoryKey
-
get_label
(name: str) → Label¶ - Calls
- Parameters
name – string
- Return type
-
get_labels
() → PaginatedList[Label]¶ - Calls
- Return type
PaginatedList
ofgithub.Label.Label
-
get_languages
() → dict[str, int]¶ - Calls
- Return type
dict of string to integer
-
get_license
() → ContentFile¶ - Calls
- Return type
-
get_milestone
(number: int) → Milestone¶ - Calls
- Parameters
number – integer
- Return type
-
get_milestones
(state: Opt[str] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet) → PaginatedList[Milestone]¶ - Calls
- Parameters
state – string
sort – string
direction – string
- Return type
PaginatedList
ofgithub.Milestone.Milestone
-
get_network_events
() → PaginatedList[Event]¶ - Calls
- Return type
PaginatedList
ofgithub.Event.Event
-
get_public_key
(secret_type: str = 'actions') → PublicKey¶ - Calls
- Parameters
secret_type – string options actions or dependabot
- Return type
-
get_pull
(number: int) → PullRequest¶ - Calls
- Parameters
number – integer
- Return type
-
get_pulls
(state: Opt[str] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet, base: Opt[str] = NotSet, head: Opt[str] = NotSet) → PaginatedList[PullRequest]¶ - Calls
- Parameters
state – string
sort – string
direction – string
base – string
head – string
- Return type
PaginatedList
ofgithub.PullRequest.PullRequest
-
get_pulls_comments
(sort: Opt[str] = NotSet, direction: Opt[str] = NotSet, since: Opt[datetime] = NotSet) → PaginatedList[PullRequestComment]¶ - Calls
- Parameters
sort – string
direction – string
since – datetime
- Return type
PaginatedList
ofgithub.PullRequestComment.PullRequestComment
-
get_pulls_review_comments
(sort: Opt[str] = NotSet, direction: Opt[str] = NotSet, since: Opt[datetime] = NotSet) → PaginatedList[PullRequestComment]¶ - Calls
- Parameters
sort – string ‘created’, ‘updated’, ‘created_at’
direction – string ‘asc’ or ‘desc’
since – datetime
- Return type
PaginatedList
ofgithub.PullRequestComment.PullRequestComment
-
get_readme
(ref: Opt[str] = NotSet) → ContentFile¶ - Calls
- Parameters
ref – string
- Return type
-
get_self_hosted_runner
(runner_id: int) → SelfHostedActionsRunner¶ - Calls
- Parameters
runner_id – int
- Return type
-
get_self_hosted_runners
() → PaginatedList[SelfHostedActionsRunner]¶ - Calls
- Return type
PaginatedList
ofgithub.SelfHostedActionsRunner.SelfHostedActionsRunner
-
get_source_import
() → SourceImport | None¶
-
get_stargazers
() → PaginatedList[NamedUser]¶ - Calls
- Return type
PaginatedList
ofgithub.NamedUser.NamedUser
-
get_stargazers_with_dates
() → PaginatedList[Stargazer]¶ - Calls
- Return type
PaginatedList
ofgithub.Stargazer.Stargazer
-
get_stats_contributors
() → list[StatsContributor] | None¶ - Calls
- Return type
None or list of
github.StatsContributor.StatsContributor
-
get_stats_commit_activity
() → list[StatsCommitActivity] | None¶ - Calls
- Return type
None or list of
github.StatsCommitActivity.StatsCommitActivity
-
get_stats_code_frequency
() → list[StatsCodeFrequency] | None¶ - Calls
- Return type
None or list of
github.StatsCodeFrequency.StatsCodeFrequency
-
get_stats_participation
() → StatsParticipation | None¶ - Calls
- Return type
-
get_stats_punch_card
() → StatsPunchCard | None¶ - Calls
- Return type
-
get_subscribers
() → PaginatedList[NamedUser]¶ - Calls
- Return type
PaginatedList
ofgithub.NamedUser.NamedUser
- Calls
- Return type
PaginatedList
ofgithub.Tag.Tag
-
get_releases
() → PaginatedList[GitRelease]¶ - Calls
- Return type
PaginatedList
ofgithub.GitRelease.GitRelease
-
get_release
(id: int | str) → GitRelease¶ - Calls
- Parameters
id – int (release id), str (tag name)
- Return type
None or
github.GitRelease.GitRelease
-
get_latest_release
() → GitRelease¶ - Calls
- Return type
-
get_teams
() → PaginatedList[Team]¶ - Calls
- Return type
PaginatedList
ofgithub.Team.Team
-
get_topics
() → list[str]¶ - Calls
- Return type
list of strings
-
get_watchers
() → PaginatedList[NamedUser]¶ - Calls
- Return type
PaginatedList
ofgithub.NamedUser.NamedUser
-
get_workflows
() → PaginatedList[Workflow]¶ - Calls
- Return type
PaginatedList
ofgithub.Workflow.Workflow
-
get_workflow
(id_or_file_name: str | int) → Workflow¶ - Calls
- Parameters
id_or_file_name – int or string. Can be either a workflow ID or a filename.
- Return type
-
get_workflow_runs
(actor: Opt[NamedUser] = NotSet, branch: Opt[Branch] = NotSet, event: Opt[str] = NotSet, status: Opt[str] = NotSet, exclude_pull_requests: Opt[bool] = NotSet, head_sha: Opt[str] = NotSet, created: Opt[str] = NotSet, check_suite_id: Opt[int] = NotSet) → PaginatedList[WorkflowRun]¶ - Calls
- Parameters
actor –
github.NamedUser.NamedUser
or stringbranch –
github.Branch.Branch
or stringevent – string
status – string queued, in_progress, completed, success, failure, neutral, cancelled, skipped, timed_out, or action_required
exclude_pull_requests – bool
head_sha – string
created – string Created filter, see https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates
check_suite_id – int
- Return type
PaginatedList
ofgithub.WorkflowRun.WorkflowRun
-
get_workflow_run
(id_: int) → WorkflowRun¶ - Calls
- Parameters
id – int
- Return type
-
has_in_assignees
(assignee: str | NamedUser) → bool¶ - Calls
- Parameters
assignee – string or
github.NamedUser.NamedUser
- Return type
bool
-
has_in_collaborators
(collaborator: str | NamedUser) → bool¶ - Calls
- Parameters
collaborator – string or
github.NamedUser.NamedUser
- Return type
bool
-
legacy_search_issues
(state: str, keyword: str) → list[Issue]¶ - Calls
GET /legacy/issues/search/{owner}/{repository}/{state}/{keyword}
- Parameters
state – “open” or “closed”
keyword – string
- Return type
List of
github.Issue.Issue
-
get_notifications
(all: Opt[bool] = NotSet, participating: Opt[bool] = NotSet, since: Opt[datetime] = NotSet, before: Opt[datetime] = NotSet) → PaginatedList[Notification]¶ - Calls
- Parameters
all – bool
participating – bool
since – datetime
before – datetime
- Return type
PaginatedList
ofgithub.Notification.Notification
-
mark_notifications_as_read
(last_read_at: datetime.datetime = datetime.datetime(2024, 11, 6, 23, 13, 20, 39460, tzinfo=datetime.timezone.utc)) → None¶ - Calls
- Parameters
last_read_at – datetime
-
merge
(base: str, head: str, commit_message: Opt[str] = NotSet) → Commit | None¶ - Calls
- Parameters
base – string
head – string
commit_message – string
- Return type
-
replace_topics
(topics: list[str]) → None¶ - Calls
- Parameters
topics – list of strings
- Return type
None
-
get_vulnerability_alert
() → bool¶ - Calls
- Return type
bool
-
enable_vulnerability_alert
() → bool¶ - Calls
- Return type
bool
-
disable_vulnerability_alert
() → bool¶ - Calls
- Return type
bool
-
enable_automated_security_fixes
() → bool¶ - Calls
- Return type
bool
-
disable_automated_security_fixes
() → bool¶ - Calls
- Return type
bool
-
remove_from_collaborators
(collaborator: str | NamedUser) → None¶ - Calls
- Parameters
collaborator – string or
github.NamedUser.NamedUser
- Return type
None
-
remove_self_hosted_runner
(runner: SelfHostedActionsRunner | int) → bool¶ - Calls
- Parameters
runner – int or
github.SelfHostedActionsRunner.SelfHostedActionsRunner
- Return type
bool
-
remove_autolink
(autolink: Autolink | int) → bool¶ - Calls
- Parameters
autolink – int or
github.Autolink.Autolink
- Return type
None
-
subscribe_to_hub
(event: str, callback: str, secret: Union[str, github.GithubObject._NotSetType] = NotSet) → None¶ - Calls
- Parameters
event – string
callback – string
secret – string
- Return type
None
-
unsubscribe_from_hub
(event: str, callback: str) → None¶ - Calls
- Parameters
event – string
callback – string
secret – string
- Return type
None
-
create_check_suite
(head_sha: str) → CheckSuite¶ - Calls
- Parameters
head_sha – string
- Return type
-
get_check_suite
(check_suite_id: int) → CheckSuite¶ - Calls
- Parameters
check_suite_id – int
- Return type
-
update_check_suites_preferences
(auto_trigger_checks: list[dict[str, bool | int]]) → RepositoryPreferences¶ - Calls
- Parameters
auto_trigger_checks – list of dict
- Return type
-
create_check_run
(name: str, head_sha: str, details_url: Opt[str] = NotSet, external_id: Opt[str] = NotSet, status: Opt[str] = NotSet, started_at: Opt[datetime] = NotSet, conclusion: Opt[str] = NotSet, completed_at: Opt[datetime] = NotSet, output: Opt[dict[str, str | list[dict[str, str | int]]]] = NotSet, actions: Opt[list[dict[str, str]]] = NotSet) → CheckRun¶ - Calls
- Parameters
name – string
head_sha – string
details_url – string
external_id – string
status – string
started_at – datetime
conclusion – string
completed_at – datetime
output – dict
actions – list of dict
- Return type
-
get_check_run
(check_run_id: int) → CheckRun¶ - Calls
- Parameters
check_run_id – int
- Return type
-
get_artifacts
(name: Opt[str] = NotSet) → PaginatedList[Artifact]¶ - Calls
- Parameters
name – str
- Return type
PaginatedList
ofgithub.Artifact.Artifact
-
get_artifact
(artifact_id: int) → Artifact¶ - Calls
- Parameters
artifact_id – int
- Return type
-
get_codescan_alerts
() → PaginatedList[CodeScanAlert]¶ - Calls
GET https://api.github.com/repos/{owner}/{repo}/code-scanning/alerts
- Return type
PaginatedList
ofgithub.CodeScanAlert.CodeScanAlert
-
get_environments
() → github.PaginatedList.PaginatedList[github.Environment.Environment][github.Environment.Environment]¶ - Calls
GET /repositories/{self._repository.id}/environments/{self.environment_name}/environments
- Return type
PaginatedList
ofgithub.Environment.Environment
-
get_environment
(environment_name: str) → github.Environment.Environment¶
-
create_environment
(environment_name: str, wait_timer: int = 0, reviewers: list[ReviewerParams] = [], deployment_branch_policy: EnvironmentDeploymentBranchPolicyParams | None = None) → Environment¶ - Calls
- Parameters
environment_name – string
wait_timer – int
reviews – List[:class:github.EnvironmentDeploymentBranchPolicy.EnvironmentDeploymentBranchPolicyParams]
deployment_branch_policy – Optional[:class:github.EnvironmentDeploymentBranchPolicy.EnvironmentDeploymentBranchPolicyParams`]
- Return type
-
delete_environment
(environment_name: str) → None¶ - Calls
- Parameters
environment_name – string
- Return type
None
-
get_dependabot_alerts
(state: Opt[str] = NotSet, severity: Opt[str] = NotSet, ecosystem: Opt[str] = NotSet, package: Opt[str] = NotSet, manifest: Opt[str] = NotSet, scope: Opt[str] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet) → PaginatedList[DependabotAlert]¶ - Calls
- Parameters
state – Optional string
severity – Optional string
ecosystem – Optional string
package – Optional string
manifest – Optional string
scope – Optional string
sort – Optional string
direction – Optional string
- Return type
PaginatedList
ofgithub.DependabotAlert.DependabotAlert
-
get_dependabot_alert
(number: int) → DependabotAlert¶ - Calls
- Parameters
number – int
- Return type
-
update_dependabot_alert
(number: int, state: str, dismissed_reason: Opt[str] = NotSet, dismissed_comment: Opt[str] = NotSet) → DependabotAlert¶ - Calls
PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}
- Parameters
number – int
state – string
dismissed_reason – Optional string
dismissed_comment – Optional string
- Return type
-
get_custom_properties
() → dict[str, None | str | list]¶ - Calls
- Return type
dict[str, None | str | list]
-
update_custom_properties
(properties: dict[str, None | str | list]) → None¶ - Calls
- Return type
None
-
property