Repository¶
-
class
github.Repository.
Repository
¶ This class represents Repositories. The reference can be found here https://docs.github.com/en/rest/reference/repos
-
allow_auto_merge
¶ Type: bool
-
allow_forking
¶ Type: bool
-
allow_merge_commit
¶ Type: bool
-
allow_rebase_merge
¶ Type: bool
-
allow_squash_merge
¶ Type: bool
-
allow_update_branch
¶ Type: bool
-
archived
¶ Type: bool
-
archive_url
¶ Type: string
-
assignees_url
¶ Type: string
-
blobs_url
¶ Type: string
-
branches_url
¶ Type: string
-
clone_url
¶ Type: string
-
collaborators_url
¶ Type: string
-
comments_url
¶ Type: string
-
commits_url
¶ Type: string
-
compare_url
¶ Type: string
-
contents_url
¶ Type: string
-
contributors_url
¶ Type: string
-
created_at
¶ Type: datetime
-
default_branch
¶ Type: string
-
delete_branch_on_merge
¶ Type: bool
-
deployments_url
¶ Type: string
-
description
¶ Type: string
-
downloads_url
¶ Type: string
-
events_url
¶ Type: string
-
fork
¶ Type: bool
-
forks
¶ Type: integer
-
forks_count
¶ Type: integer
-
forks_url
¶ Type: string
-
full_name
¶ Type: string
-
git_commits_url
¶ Type: string
-
git_refs_url
¶ Type: string
Type: string
-
git_url
¶ Type: string
-
has_downloads
¶ Type: bool
-
has_issues
¶ Type: bool
-
has_pages
¶ Type: bool
-
has_projects
¶ Type: bool
-
has_wiki
¶ Type: bool
-
homepage
¶ Type: string
-
hooks_url
¶ Type: string
-
html_url
¶ Type: string
-
id
¶ Type: integer
-
is_template
¶ Type: bool
-
issue_comment_url
¶ Type: string
-
issue_events_url
¶ Type: string
-
issues_url
¶ Type: string
-
keys_url
¶ Type: string
-
labels_url
¶ Type: string
-
language
¶ Type: string
-
languages_url
¶ Type: string
-
license
¶ Type: github.License.License
-
master_branch
¶ Type: string
-
merge_commit_message
¶ Type: string
-
merge_commit_title
¶ Type: string
-
merges_url
¶ Type: string
-
milestones_url
¶ Type: string
-
mirror_url
¶ Type: string
-
name
¶ Type: string
-
network_count
¶ Type: integer
-
notifications_url
¶ Type: string
-
open_issues
¶ Type: integer
-
open_issues_count
¶ Type: integer
-
organization
¶ Type: github.Organization.Organization
-
owner
¶ Type: github.NamedUser.NamedUser
-
parent
¶ Type: github.Repository.Repository
-
permissions
¶ Type: github.Permissions.Permissions
-
private
¶ Type: bool
-
pulls_url
¶ Type: string
-
pushed_at
¶ Type: datetime
-
releases_url
¶ Type: string
-
size
¶ Type: integer
-
source
¶ Type: github.Repository.Repository
-
squash_merge_commit_message
¶ Type: string
-
squash_merge_commit_title
¶ Type: string
-
ssh_url
¶ Type: string
-
stargazers_count
¶ Type: integer
-
stargazers_url
¶ Type: string
-
statuses_url
¶ Type: string
-
subscribers_url
¶ Type: string
-
subscribers_count
¶ Type: integer
-
subscription_url
¶ Type: string
-
svn_url
¶ Type: string
Type: string
-
teams_url
¶ Type: string
-
topics
¶ Type: list of strings
-
trees_url
¶ Type: string
-
updated_at
¶ Type: datetime
-
url
¶ Type: string
-
use_squash_pr_title_as_default
¶ Type: bool
-
visibility
¶ Type: string
-
watchers
¶ Type: integer
-
watchers_count
¶ Type: integer
-
web_commit_signoff_required
¶ Type: bool
-
add_to_collaborators
(collaborator, permission=NotSet)¶ Calls: Parameters: - collaborator – string or
github.NamedUser.NamedUser
- permission – string ‘pull’, ‘push’ or ‘admin’
Return type: None
- collaborator – string or
-
get_collaborator_permission
(collaborator)¶ Calls: GET /repos/{owner}/{repo}/collaborators/{username}/permission Parameters: collaborator – string or github.NamedUser.NamedUser
Return type: string
-
get_pending_invitations
()¶ Calls: GET /repos/{owner}/{repo}/invitations Return type: github.PaginatedList.PaginatedList
ofgithub.Invitation.Invitation
-
remove_invitation
(invite_id)¶ Calls: DELETE /repos/{owner}/{repo}/invitations/{invitation_id} Return type: None
-
compare
(base, head)¶ Calls: Parameters: - base – string
- head – string
Return type:
-
create_autolink
(key_prefix, url_template, is_alphanumeric=NotSet)¶ Calls: Parameters: - key_prefix – string
- url_template – string
- is_alphanumeric – bool
Return type:
-
create_git_blob
(content, encoding)¶ Calls: Parameters: - content – string
- encoding – string
Return type:
-
create_git_commit
(message, tree, parents, author=NotSet, committer=NotSet)¶ 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, sha)¶ Calls: Parameters: - ref – string
- sha – string
Return type:
-
create_git_tag_and_release
(tag, tag_message, release_name, release_message, object, type, tagger=NotSet, draft=False, prerelease=False, generate_release_notes=False)¶ Convenience function that calls
Repository.create_git_tag()
andRepository.create_git_release()
. :param tag: string :param tag_message: string :param release_name: string :param release_message: string :param object: string :param type: string :param tagger: :class:github.InputGitAuthor.InputGitAuthor :param draft: bool :param prerelease: bool :param generate_release_notes: bool :rtype:github.GitRelease.GitRelease
-
create_git_release
(tag, name, message, draft=False, prerelease=False, generate_release_notes=False, target_commitish=NotSet)¶ 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, message, object, type, tagger=NotSet)¶ Calls: Parameters: - tag – string
- message – string
- object – string
- type – string
- tagger –
github.InputGitAuthor.InputGitAuthor
Return type:
-
create_git_tree
(tree, base_tree=NotSet)¶ Calls: Parameters: - tree – list of
github.InputGitTreeElement.InputGitTreeElement
- base_tree –
github.GitTree.GitTree
Return type: - tree – list of
-
create_hook
(name, config, events=NotSet, active=NotSet)¶ Calls: Parameters: - name – string
- config – dict
- events – list of string
- active – bool
Return type:
-
create_issue
(title, body=NotSet, assignee=NotSet, milestone=NotSet, labels=NotSet, assignees=NotSet)¶ 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, key, read_only=False)¶ Calls: Parameters: - title – string
- key – string
- read_only – bool
Return type:
-
create_label
(name, color, description=NotSet)¶ Calls: Parameters: - name – string
- color – string
- description – string
Return type:
-
create_milestone
(title, state=NotSet, description=NotSet, due_on=NotSet)¶ Calls: Parameters: - title – string
- state – string
- description – string
- due_on – datetime
Return type:
-
create_project
(name, body=NotSet)¶ Calls: Parameters: - name – string
- body – string
Return type:
-
create_pull
(*args, **kwds)¶ Calls: Parameters: - title – string
- body – string
- issue –
github.Issue.Issue
- base – string
- head – string
- draft – bool
- maintainer_can_modify – bool
Return type:
-
create_repository_advisory
(summary: str, description: str, severity_or_cvss_vector_string: str, cve_id: Optional[str] = None, vulnerabilities: Optional[Iterable[Union[github.RepositoryAdvisoryVulnerability.SimpleAdvisoryVulnerability, RepositoryAdvisoryVulnerability]]] = None, cwe_ids: Optional[Iterable[str]] = None, credits: Optional[Iterable[github.RepositoryAdvisoryCredit.RepositoryAdvisoryCredit]] = None) → github.RepositoryAdvisory.RepositoryAdvisory¶ Calls: Parameters: - summary – string
- description – string
- severity_or_cvss_vector_string – string
- cve_id – string
- vulnerabilities – iterable of
github.RepositoryAdvisoryVulnerability.AdvisoryVulnerability
- cwe_ids – iterable of string
- credits – iterable of
github.RepositoryAdvisoryCredit.RepositoryAdvisoryCredit
Return type:
-
report_security_vulnerability
(summary: str, description: str, severity_or_cvss_vector_string: str, cve_id: Optional[str] = None, vulnerabilities: Optional[Iterable[Union[github.RepositoryAdvisoryVulnerability.SimpleAdvisoryVulnerability, RepositoryAdvisoryVulnerability]]] = None, cwe_ids: Optional[Iterable[str]] = None, credits: Optional[Iterable[github.RepositoryAdvisoryCredit.RepositoryAdvisoryCredit]] = None) → github.RepositoryAdvisory.RepositoryAdvisory¶ Calls: Parameters: - summary – string
- description – string
- severity_or_cvss_vector_string – string
- cve_id – string
- vulnerabilities – iterable of
github.RepositoryAdvisoryVulnerability.AdvisoryVulnerability
- cwe_ids – iterable of string
- credits – iterable of
github.RepositoryAdvisoryCredit.RepositoryAdvisoryCredit
Return type:
-
create_repository_dispatch
(event_type, client_payload=NotSet)¶ 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, unencrypted_value)¶ Calls: Parameters: - secret_name – string
- unencrypted_value – string
Return type:
-
get_secrets
()¶ Gets all repository secrets :rtype:
github.PaginatedList.PaginatedList
ofgithub.Secret.Secret
-
get_secret
(secret_name: str)¶ Calls: ‘GET /repos/{owner}/{repo}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#get-an-organization-secret>`_ Parameters: secret_name – string Return type: github.Secret.Secret
-
create_variable
(variable_name: str, value: str) → bool¶ Calls: POST /repos/{owner}/{repo}/actions/variables/{variable_name}
Parameters: - variable_name – string
- value – string
Return type: bool
-
get_variables
()¶ Gets all repository variables :rtype:
github.PaginatedList.PaginatedList
ofgithub.Variable.Variable
-
get_variable
(variable_name: str)¶ 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: github.Variable.Variable
-
create_source_import
(vcs, vcs_url, vcs_username=NotSet, vcs_password=NotSet)¶ Calls: Parameters: - vcs – string
- vcs_url – string
- vcs_username – string
- vcs_password – string
Return type:
-
delete
()¶ Calls: DELETE /repos/{owner}/{repo} Return type: None
-
edit
(name=None, description=NotSet, homepage=NotSet, private=NotSet, visibility=NotSet, has_issues=NotSet, has_projects=NotSet, has_wiki=NotSet, is_template=NotSet, default_branch=NotSet, allow_squash_merge=NotSet, allow_merge_commit=NotSet, allow_rebase_merge=NotSet, allow_auto_merge=NotSet, delete_branch_on_merge=NotSet, allow_update_branch=NotSet, use_squash_pr_title_as_default=NotSet, squash_merge_commit_title=NotSet, squash_merge_commit_message=NotSet, merge_commit_title=NotSet, merge_commit_message=NotSet, archived=NotSet, allow_forking=NotSet, web_commit_signoff_required=NotSet)¶ Calls: Parameters: - name – string
- description – string
- homepage – string
- private – bool
- visibility – string
- has_issues – bool
- has_projects – bool
- has_wiki – bool
- is_template – bool
- default_branch – string
- allow_squash_merge – bool
- allow_merge_commit – bool
- allow_rebase_merge – bool
- allow_auto_merge – bool
- delete_branch_on_merge – bool
- allow_update_branch – bool
- use_squash_pr_title_as_default – bool
:param squash_merge_commit_title : string :param squash_merge_commit_message : string :param merge_commit_title : string :param merge_commit_message : string :param archived: bool :param allow_forking: bool :param web_commit_signoff_required: bool :rtype: None
-
get_archive_link
(archive_format, ref=NotSet)¶ Calls: Parameters: - archive_format – string
- ref – string
Return type: string
-
get_assignees
()¶ Calls: GET /repos/{owner}/{repo}/assignees Return type: github.PaginatedList.PaginatedList
ofgithub.NamedUser.NamedUser
-
get_branch
(branch)¶ Calls: GET /repos/{owner}/{repo}/branches/{branch} Parameters: branch – string Return type: github.Branch.Branch
-
rename_branch
(branch, new_name)¶ Calls: Parameters: - branch –
github.Branch.Branch
or string - new_name – string
Return type: bool
NOTE: This method does not return the branch since it may take some time to fully complete server-side.
- branch –
-
get_branches
()¶ Calls: GET /repos/{owner}/{repo}/branches Return type: github.PaginatedList.PaginatedList
ofgithub.Branch.Branch
-
get_collaborators
(affiliation=NotSet)¶ Calls: GET /repos/{owner}/{repo}/collaborators Parameters: affiliation – string Return type: github.PaginatedList.PaginatedList
ofgithub.NamedUser.NamedUser
-
get_comment
(id)¶ Calls: GET /repos/{owner}/{repo}/comments/{id} Parameters: id – integer Return type: github.CommitComment.CommitComment
-
get_comments
()¶ Calls: GET /repos/{owner}/{repo}/comments Return type: github.PaginatedList.PaginatedList
ofgithub.CommitComment.CommitComment
-
get_commit
(sha)¶ Calls: GET /repos/{owner}/{repo}/commits/{sha} Parameters: sha – string Return type: github.Commit.Commit
-
get_commits
(sha=NotSet, path=NotSet, since=NotSet, until=NotSet, author=NotSet)¶ Calls: Parameters: - sha – string
- path – string
- since – datetime
- until – datetime
- author – string or
github.NamedUser.NamedUser
orgithub.AuthenticatedUser.AuthenticatedUser
Return type:
-
get_contents
(path, ref=NotSet)¶ Calls: Parameters: - path – string
- ref – string
Return type: github.ContentFile.ContentFile
or a list of them
-
get_deployments
(sha=NotSet, ref=NotSet, task=NotSet, environment=NotSet)¶ Calls: GET /repos/{owner}/{repo}/deployments Param: sha: string Param: ref: string Param: task: string Param: environment: string Return type: github.PaginatedList.PaginatedList
ofgithub.Deployment.Deployment
-
get_deployment
(id_)¶ Calls: GET /repos/{owner}/{repo}/deployments/{deployment_id} Param: id_: int Return type: github.Deployment.Deployment
-
create_deployment
(ref, task=NotSet, auto_merge=NotSet, required_contexts=NotSet, payload=NotSet, environment=NotSet, description=NotSet, transient_environment=NotSet, production_environment=NotSet)¶ Calls: POST /repos/{owner}/{repo}/deployments 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: github.Deployment.Deployment
-
get_top_referrers
()¶ Calls: GET /repos/{owner}/{repo}/traffic/popular/referrers Return type: list
ofgithub.Referrer.Referrer
-
get_top_paths
()¶ Calls: GET /repos/{owner}/{repo}/traffic/popular/paths Return type: list
ofgithub.Path.Path
-
get_views_traffic
(per=NotSet)¶ Calls: GET /repos/{owner}/{repo}/traffic/views Parameters: per – string, must be one of day or week, day by default Return type: None or list of github.View.View
-
get_clones_traffic
(per=NotSet)¶ Calls: GET /repos/{owner}/{repo}/traffic/clones 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=NotSet)¶ Calls: GET /repos/{owner}/{repo}/projects Return type: github.PaginatedList.PaginatedList
ofgithub.Project.Project
Parameters: state – string
-
get_autolinks
()¶ Calls: GET /repos/{owner}/{repo}/autolinks Return type: github.PaginatedList.PaginatedList
ofgithub.Autolink.Autolink
-
create_file
(path, message, content, branch=NotSet, committer=NotSet, author=NotSet)¶ Create a file in this repository.
Calls: Parameters: - path – string, (required), path of the file in the repository
- message – string, (required), commit message
- content – string, (required), the actual data in the file
- branch – string, (optional), branch to create the commit on. Defaults to the default branch of the repository
- 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: GET /repos/{owner}/{repo}/security-advisories Return type: github.PaginatedList.PaginatedList
ofgithub.RepositoryAdvisory.RepositoryAdvisory
-
get_repository_advisory
(ghsa: str) → github.RepositoryAdvisory.RepositoryAdvisory¶ Calls: GET /repos/{owner}/{repo}/security-advisories/{ghsa} Parameters: ghsa – string Return type: github.RepositoryAdvisory.RepositoryAdvisory
-
update_file
(path, message, content, sha, branch=NotSet, committer=NotSet, author=NotSet)¶ This method updates a file in a repository
Calls: Parameters: - path – string, Required. The content path.
- message – string, Required. The commit message.
- content – string, Required. The updated file content, either base64 encoded, or ready to be encoded.
- sha – string, Required. The blob SHA of the file being replaced.
- branch – string. The branch name. Default: the repository’s default branch (usually master)
- 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
}
-
delete_file
(path, message, sha, branch=NotSet, committer=NotSet, author=NotSet)¶ This method deletes a file in a repository
Calls: Parameters: - path – string, Required. The content path.
- message – string, Required. The commit message.
- sha – string, Required. The blob SHA of the file being replaced.
- branch – string. The branch name. Default: the repository’s default branch (usually master)
- 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’:
null
:, ‘commit’:Commit
}
-
get_dir_contents
(path, ref=NotSet)¶ Calls: Parameters: - path – string
- ref – string
Return type: list of
github.ContentFile.ContentFile
-
get_contributors
(anon=NotSet)¶ Calls: GET /repos/{owner}/{repo}/contributors Parameters: anon – string Return type: github.PaginatedList.PaginatedList
ofgithub.NamedUser.NamedUser
-
get_download
(id)¶ Calls: GET /repos/{owner}/{repo}/downloads/{id} Parameters: id – integer Return type: github.Download.Download
-
get_downloads
()¶ Calls: GET /repos/{owner}/{repo}/downloads Return type: github.PaginatedList.PaginatedList
ofgithub.Download.Download
-
get_events
()¶ Calls: GET /repos/{owner}/{repo}/events Return type: github.PaginatedList.PaginatedList
ofgithub.Event.Event
-
get_forks
()¶ Calls: GET /repos/{owner}/{repo}/forks Return type: github.PaginatedList.PaginatedList
ofgithub.Repository.Repository
-
create_fork
(organization=NotSet, name=NotSet, default_branch_only=NotSet)¶ Calls: Parameters: - organization –
github.Organization.Organization
or string - name – string
- default_branch_only – bool
Return type: - organization –
-
get_git_blob
(sha)¶ Calls: GET /repos/{owner}/{repo}/git/blobs/{sha} Parameters: sha – string Return type: github.GitBlob.GitBlob
-
get_git_commit
(sha)¶ Calls: GET /repos/{owner}/{repo}/git/commits/{sha} Parameters: sha – string Return type: github.GitCommit.GitCommit
-
get_git_ref
(ref)¶ Calls: GET /repos/{owner}/{repo}/git/refs/{ref} Parameters: ref – string Return type: github.GitRef.GitRef
-
get_git_refs
()¶ Calls: GET /repos/{owner}/{repo}/git/refs Return type: github.PaginatedList.PaginatedList
ofgithub.GitRef.GitRef
-
get_git_matching_refs
(ref)¶ Calls: GET /repos/{owner}/{repo}/git/matching-refs/{ref} Return type: github.PaginatedList.PaginatedList
ofgithub.GitRef.GitRef
-
get_git_tag
(sha)¶ Calls: GET /repos/{owner}/{repo}/git/tags/{sha} Parameters: sha – string Return type: github.GitTag.GitTag
-
get_git_tree
(sha, recursive=NotSet)¶ Calls: Parameters: - sha – string
- recursive – bool
Return type:
-
get_hook
(id)¶ Calls: GET /repos/{owner}/{repo}/hooks/{id} Parameters: id – integer Return type: github.Hook.Hook
-
get_hooks
()¶ Calls: GET /repos/{owner}/{repo}/hooks Return type: github.PaginatedList.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: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries Parameters: hook_id – integer Return type: github.PaginatedList.PaginatedList
ofgithub.HookDelivery.HookDeliverySummary
-
get_issue
(number)¶ Calls: GET /repos/{owner}/{repo}/issues/{number} Parameters: number – integer Return type: github.Issue.Issue
-
get_issues
(milestone=NotSet, state=NotSet, assignee=NotSet, mentioned=NotSet, labels=NotSet, sort=NotSet, direction=NotSet, since=NotSet, creator=NotSet)¶ 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: - milestone –
-
get_issues_comments
(sort=NotSet, direction=NotSet, since=NotSet)¶ Calls: Parameters: - sort – string
- direction – string
- since – datetime
Return type: github.PaginatedList.PaginatedList
ofgithub.IssueComment.IssueComment
-
get_issues_event
(id)¶ Calls: GET /repos/{owner}/{repo}/issues/events/{id} Parameters: id – integer Return type: github.IssueEvent.IssueEvent
-
get_issues_events
()¶ Calls: GET /repos/{owner}/{repo}/issues/events Return type: github.PaginatedList.PaginatedList
ofgithub.IssueEvent.IssueEvent
-
get_key
(id)¶ Calls: GET /repos/{owner}/{repo}/keys/{id} Parameters: id – integer Return type: github.RepositoryKey.RepositoryKey
-
get_keys
()¶ Calls: GET /repos/{owner}/{repo}/keys Return type: github.PaginatedList.PaginatedList
ofgithub.RepositoryKey.RepositoryKey
-
get_label
(name)¶ Calls: GET /repos/{owner}/{repo}/labels/{name} Parameters: name – string Return type: github.Label.Label
-
get_labels
()¶ Calls: GET /repos/{owner}/{repo}/labels Return type: github.PaginatedList.PaginatedList
ofgithub.Label.Label
-
get_languages
()¶ Calls: GET /repos/{owner}/{repo}/languages Return type: dict of string to integer
-
get_license
()¶ Calls: GET /repos/{owner}/{repo}/license Return type: github.ContentFile.ContentFile
-
get_milestone
(number)¶ Calls: GET /repos/{owner}/{repo}/milestones/{number} Parameters: number – integer Return type: github.Milestone.Milestone
-
get_milestones
(state=NotSet, sort=NotSet, direction=NotSet)¶ Calls: Parameters: - state – string
- sort – string
- direction – string
Return type: github.PaginatedList.PaginatedList
ofgithub.Milestone.Milestone
-
get_network_events
()¶ Calls: GET /networks/{owner}/{repo}/events Return type: github.PaginatedList.PaginatedList
ofgithub.Event.Event
-
get_public_key
()¶ Calls: GET /repos/{owner}/{repo}/actions/secrets/public-key Return type: github.PublicKey.PublicKey
-
get_pull
(number)¶ Calls: GET /repos/{owner}/{repo}/pulls/{number} Parameters: number – integer Return type: github.PullRequest.PullRequest
-
get_pulls
(state=NotSet, sort=NotSet, direction=NotSet, base=NotSet, head=NotSet)¶ Calls: Parameters: - state – string
- sort – string
- direction – string
- base – string
- head – string
Return type: github.PaginatedList.PaginatedList
ofgithub.PullRequest.PullRequest
-
get_pulls_comments
(sort=NotSet, direction=NotSet, since=NotSet)¶ Calls: Parameters: - sort – string
- direction – string
- since – datetime
Return type: github.PaginatedList.PaginatedList
ofgithub.PullRequestComment.PullRequestComment
-
get_pulls_review_comments
(sort=NotSet, direction=NotSet, since=NotSet)¶ Calls: Parameters: - sort – string ‘created’, ‘updated’, ‘created_at’
- direction – string ‘asc’ or ‘desc’
- since – datetime
Return type: github.PaginatedList.PaginatedList
ofgithub.PullRequestComment.PullRequestComment
-
get_readme
(ref=NotSet)¶ Calls: GET /repos/{owner}/{repo}/readme Parameters: ref – string Return type: github.ContentFile.ContentFile
-
get_self_hosted_runner
(runner_id)¶ Calls: GET /repos/{owner}/{repo}/actions/runners/{id} Parameters: runner_id – int Return type: github.SelfHostedActionsRunner.SelfHostedActionsRunner
-
get_self_hosted_runners
()¶ Calls: GET /repos/{owner}/{repo}/actions/runners Return type: github.PaginatedList.PaginatedList
ofgithub.SelfHostedActionsRunner.SelfHostedActionsRunner
-
get_source_import
()¶ Calls: GET /repos/{owner}/{repo}/import Return type: github.SourceImport.SourceImport
-
get_stargazers
()¶ Calls: GET /repos/{owner}/{repo}/stargazers Return type: github.PaginatedList.PaginatedList
ofgithub.NamedUser.NamedUser
-
get_stargazers_with_dates
()¶ Calls: GET /repos/{owner}/{repo}/stargazers Return type: github.PaginatedList.PaginatedList
ofgithub.Stargazer.Stargazer
-
get_stats_contributors
()¶ Calls: GET /repos/{owner}/{repo}/stats/contributors Return type: None or list of github.StatsContributor.StatsContributor
-
get_stats_commit_activity
()¶ Calls: GET /repos/{owner}/{repo}/stats/commit_activity Return type: None or list of github.StatsCommitActivity.StatsCommitActivity
-
get_stats_code_frequency
()¶ Calls: GET /repos/{owner}/{repo}/stats/code_frequency Return type: None or list of github.StatsCodeFrequency.StatsCodeFrequency
-
get_stats_participation
()¶ Calls: GET /repos/{owner}/{repo}/stats/participation Return type: None or github.StatsParticipation.StatsParticipation
-
get_stats_punch_card
()¶ Calls: GET /repos/{owner}/{repo}/stats/punch_card Return type: None or github.StatsPunchCard.StatsPunchCard
-
get_subscribers
()¶ Calls: GET /repos/{owner}/{repo}/subscribers Return type: github.PaginatedList.PaginatedList
ofgithub.NamedUser.NamedUser
Calls: GET /repos/{owner}/{repo}/tags Return type: github.PaginatedList.PaginatedList
ofgithub.Tag.Tag
-
get_releases
()¶ Calls: GET /repos/{owner}/{repo}/releases Return type: github.PaginatedList.PaginatedList
ofgithub.GitRelease.GitRelease
-
get_release
(id)¶ Calls: GET /repos/{owner}/{repo}/releases/{id} Parameters: id – int (release id), str (tag name) Return type: None or github.GitRelease.GitRelease
-
get_latest_release
()¶ Calls: GET /repos/{owner}/{repo}/releases/latest Return type: github.GitRelease.GitRelease
-
get_teams
()¶ Calls: GET /repos/{owner}/{repo}/teams Return type: github.PaginatedList.PaginatedList
ofgithub.Team.Team
-
get_topics
()¶ Calls: GET /repos/{owner}/{repo}/topics Return type: list of strings
-
get_watchers
()¶ Calls: GET /repos/{owner}/{repo}/watchers Return type: github.PaginatedList.PaginatedList
ofgithub.NamedUser.NamedUser
-
get_workflows
()¶ Calls: GET /repos/{owner}/{repo}/actions/workflows Return type: github.PaginatedList.PaginatedList
ofgithub.Workflow.Workflow
-
get_workflow
(id_or_file_name)¶ Calls: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} Parameters: id_or_file_name – int or string. Can be either a workflow ID or a filename. Return type: github.Workflow.Workflow
-
get_workflow_runs
(actor=NotSet, branch=NotSet, event=NotSet, status=NotSet, exclude_pull_requests=NotSet, head_sha=NotSet)¶ Calls: Parameters: - actor –
github.NamedUser.NamedUser
or string - branch –
github.Branch.Branch
or string - event – string
- status – string queued, in_progress, completed, success, failure, neutral, cancelled, skipped, timed_out, or action_required
- exclude_pull_requests – bool
- head_sha – string
Return type: github.PaginatedList.PaginatedList
ofgithub.WorkflowRun.WorkflowRun
- actor –
-
get_workflow_run
(id_)¶ Calls: GET /repos/{owner}/{repo}/actions/runs/{run_id} Parameters: id – int Return type: github.WorkflowRun.WorkflowRun
-
has_in_assignees
(assignee)¶ Calls: GET /repos/{owner}/{repo}/assignees/{assignee} Parameters: assignee – string or github.NamedUser.NamedUser
Return type: bool
-
has_in_collaborators
(collaborator)¶ Calls: GET /repos/{owner}/{repo}/collaborators/{user} Parameters: collaborator – string or github.NamedUser.NamedUser
Return type: bool
-
legacy_search_issues
(state, keyword)¶ 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=NotSet, participating=NotSet, since=NotSet, before=NotSet)¶ Calls: Parameters: - all – bool
- participating – bool
- since – datetime
- before – datetime
Return type: github.PaginatedList.PaginatedList
ofgithub.Notification.Notification
-
mark_notifications_as_read
(last_read_at=datetime.datetime(2023, 9, 12, 10, 11, 25, 600356, tzinfo=datetime.timezone.utc))¶ Calls: PUT /repos/{owner}/{repo}/notifications Parameters: last_read_at – datetime
-
merge
(base, head, commit_message=NotSet)¶ Calls: Parameters: - base – string
- head – string
- commit_message – string
Return type:
-
replace_topics
(topics)¶ Calls: PUT /repos/{owner}/{repo}/topics Parameters: topics – list of strings Return type: None
-
get_vulnerability_alert
()¶ Calls: GET /repos/{owner}/{repo}/vulnerability-alerts Return type: bool
-
enable_vulnerability_alert
()¶ Calls: PUT /repos/{owner}/{repo}/vulnerability-alerts Return type: bool
-
disable_vulnerability_alert
()¶ Calls: DELETE /repos/{owner}/{repo}/vulnerability-alerts Return type: bool
-
enable_automated_security_fixes
()¶ Calls: PUT /repos/{owner}/{repo}/automated-security-fixes Return type: bool
-
disable_automated_security_fixes
()¶ Calls: DELETE /repos/{owner}/{repo}/automated-security-fixes Return type: bool
-
remove_from_collaborators
(collaborator)¶ Calls: DELETE /repos/{owner}/{repo}/collaborators/{user} Parameters: collaborator – string or github.NamedUser.NamedUser
Return type: None
-
remove_self_hosted_runner
(runner)¶ Calls: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} Parameters: runner – int or github.SelfHostedActionsRunner.SelfHostedActionsRunner
Return type: bool
-
remove_autolink
(autolink)¶ Calls: DELETE /repos/{owner}/{repo}/autolinks/{id} Parameters: autolink – int or github.Autolink.Autolink
Return type: None
-
subscribe_to_hub
(event, callback, secret=NotSet)¶ Calls: Parameters: - event – string
- callback – string
- secret – string
Return type: None
-
unsubscribe_from_hub
(event, callback)¶ Calls: Parameters: - event – string
- callback – string
- secret – string
Return type: None
-
create_check_suite
(head_sha)¶ Calls: POST /repos/{owner}/{repo}/check-suites Parameters: head_sha – string Return type: github.CheckSuite.CheckSuite
-
get_check_suite
(check_suite_id)¶ Calls: GET /repos/{owner}/{repo}/check-suites/{check_suite_id} Parameters: check_suite_id – int Return type: github.CheckSuite.CheckSuite
-
update_check_suites_preferences
(auto_trigger_checks)¶ Calls: PATCH /repos/{owner}/{repo}/check-suites/preferences Parameters: auto_trigger_checks – list of dict Return type: github.RepositoryPreferences.RepositoryPreferences
-
create_check_run
(name, head_sha, details_url=NotSet, external_id=NotSet, status=NotSet, started_at=NotSet, conclusion=NotSet, completed_at=NotSet, output=NotSet, actions=NotSet)¶ 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)¶ Calls: GET /repos/{owner}/{repo}/check-runs/{check_run_id} Parameters: check_run_id – int Return type: github.CheckRun.CheckRun
-
get_artifacts
(name=NotSet)¶ Calls: GET /repos/{owner}/{repo}/actions/artifacts Parameters: name – str Return type: github.PaginatedList.PaginatedList
ofgithub.Artifact.Artifact
-
get_artifact
(artifact_id)¶ Calls: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} Parameters: artifact_id – int Return type: github.Artifact.Artifact
-
get_codescan_alerts
()¶ Calls: GET https://api.github.com/repos/{owner}/{repo}/code-scanning/alerts Return type: github.PaginatedList.PaginatedList
ofgithub.CodeScanAlert.CodeScanAlert
-
get_environments
()¶ Calls: GET /repos/{owner}/{repo}/environments Return type: github.PaginatedList.PaginatedList
ofgithub.Environment.Environment
-
get_environment
(environment_name)¶ Calls: GET /repos/{owner}/{repo}/environments/{environment_name} Return type: github.Environment.Environment
-
create_environment
(environment_name, wait_timer=0, reviewers=[], deployment_branch_policy=None)¶ Calls: Parameters: - environment_name – string
- wait_timer – int
- reviews – List[:class:github.EnvironmentDeploymentBranchPolicy.EnvironmentDeploymentBranchPolicyParams]
- deployment_branch_policy – Optional[:class:github.EnvironmentDeploymentBranchPolicy.EnvironmentDeploymentBranchPolicyParams`]
Return type:
-
update_environment
(environment_name, wait_timer=0, reviewers=[], deployment_branch_policy=None)¶ 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)¶ Calls: DELETE /repos/{owner}/{repo}/environments/{environment_name} Parameters: environment_name – string Return type: None
-