Skip to main content

prefect_github.repository

This is a module containing: GitHub query_repository* tasks and the GitHub storage block.

Functions

query_repository

The query root of GitHub’s GraphQL interface. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_ref

Fetch a given ref from the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • qualified_name: The ref to retrieve. Fully qualified matches are checked in order (refs/heads/master) before falling back onto checks for short name matches (master).
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_refs

Fetch a list of refs from the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • ref_prefix: A ref name prefix like refs/heads/, refs/tags/, etc.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • query: Filters refs with query on name.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • direction: DEPRECATED: use orderBy. The ordering direction.
  • order_by: Ordering options for refs returned from the connection.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_owner

The User owner of the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_forks

A list of direct forked repositories. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • privacy: If non-null, filters repositories according to privacy.
  • order_by: Ordering options for repositories returned from the connection.
  • affiliations: Array of viewer’s affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the current viewer owns.
  • owner_affiliations: Array of owner’s affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the organization or user being viewed owns.
  • is_locked: If non-null, filters repositories according to whether they have been locked.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_issue

Returns a single issue from the current repository by number. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • number: The number for the issue to be returned.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_label

Returns a single label by name. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • label_name: Label name.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_issues

A list of issues that have been opened in the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • labels: A list of label names to filter the pull requests by.
  • states: A list of states to filter the issues by.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • order_by: Ordering options for issues returned from the connection.
  • filter_by: Filtering options for issues returned from the connection.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_labels

A list of labels associated with the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • order_by: Ordering options for labels returned from the connection.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • query: If provided, searches labels by name and description.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_object

A Git object in the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • oid: The Git object ID.
  • expression: A Git revision expression suitable for rev-parse.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_project

Find project by number. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • number: The project number to find.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_release

Lookup a single release given various criteria. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • tag_name: The name of the Tag the Release was created from.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_projects

A list of projects under the owner. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • states: A list of states to filter the projects by.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • order_by: Ordering options for projects returned from the connection.
  • search: Query to search projects by, currently only searching by name.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_packages

A list of packages under the owner. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • names: Find packages by their names.
  • repository_id: Find packages in a repository by ID.
  • package_type: Filter registry package by type.
  • order_by: Ordering of the returned packages.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_releases

List of releases which are dependent on this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • order_by: Order for connection.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_watchers

A list of users watching the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_languages

A list containing a breakdown of the language composition of the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • order_by: Order for connection.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_milestone

Returns a single milestone from the current repository by number. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • number: The number for the milestone to be returned.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_project_v2

Finds and returns the Project according to the provided Project number. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • number: The Project number.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_stargazers

A list of users who have starred this starrable. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • order_by: Order for connection.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_deploy_keys

A list of deploy keys that are on this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_discussion

Returns a single discussion from the current repository by number. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • number: The number for the discussion to be returned.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_milestones

A list of milestones associated with the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • states: Filter by the state of the milestones.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • order_by: Ordering options for milestones.
  • query: Filters milestones with a query on the title.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_projects_v2

List of projects linked to this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • query: A project to search for linked to the repo.
  • order_by: How to order the returned projects.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_submodules

Returns a list of all submodules in this repository parsed from the .gitmodules file as of the default branch’s HEAD commit. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_license_info

The license associated with the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_deployments

Deployments associated with the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • environments: Environments to list deployments for.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • order_by: Ordering options for deployments returned from the connection.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_discussions

A list of discussions that have been opened in the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • category_id: Only include discussions that belong to the category with this ID.
  • order_by: Ordering options for discussions returned from the connection.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_environment

Returns a single active environment from the current repository by name. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • environment_name: The name of the environment to be returned.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_project_next

Finds and returns the Project (beta) according to the provided Project (beta) number. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • number: The ProjectNext number.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_pull_request

Returns a single pull request from the current repository by number. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • number: The number for the pull request to be returned.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.
Returns a list of contact links associated to the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_environments

A list of environments that are in this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.
The funding links for this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_pinned_issues

A list of pinned issues for this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_projects_next

List of projects (beta) linked to this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • query: A project (beta) to search for linked to the repo.
  • sort_by: How to order the returned project (beta) objects.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_pull_requests

A list of pull requests that have been opened in the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • states: A list of states to filter the pull requests by.
  • labels: A list of label names to filter the pull requests by.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • head_ref_name: The head ref name to filter the pull requests by.
  • base_ref_name: The base ref name to filter the pull requests by.
  • order_by: Ordering options for pull requests returned from the connection.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_code_of_conduct

Returns the code of conduct for this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_collaborators

A list of collaborators associated with the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • affiliation: Collaborators affiliation level with a repository.
  • query: Filters users with query on user name and login.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_latest_release

Get the latest release for the repository if one exists. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_recent_projects

Recent projects that this user has modified in the context of the owner. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_commit_comments

A list of commit comments associated with the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_issue_templates

Returns a list of issue templates associated to the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_assignable_users

A list of users that can be assigned to issues in this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • query: Filters users with query on user name and login.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_primary_language

The primary language of the repository’s code. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_default_branch_ref

The Ref associated with the repository’s default branch. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_mentionable_users

A list of Users that can be mentioned in the context of the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • query: Filters users with query on user name and login.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_repository_topics

A list of applied repository-topic associations for this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_pinned_discussions

A list of discussions that have been pinned in this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_discussion_category

A discussion category by slug. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • slug: The slug of the discussion category to be returned.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_interaction_ability

The interaction ability settings for this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_issue_or_pull_request

Returns a single issue-like object from the current repository by number. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • number: The number for the issue to be returned.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_vulnerability_alerts

A list of vulnerability alerts that are on this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • states: Filter by the state of the alert.
  • dependency_scopes: Filter by the scope of the alert’s dependency.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_discussion_categories

A list of discussion categories that are available in the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • filter_by_assignable: Filter by categories that are assignable by the viewer.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_pull_request_templates

Returns a list of pull request templates associated to the repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

query_repository_branch_protection_rules

A list of branch protection rules for this repository. Args:
  • owner: The login field of a user or organization.
  • name: The name of the repository.
  • github_credentials: Credentials to use for authentication with GitHub.
  • follow_renames: Follow repository renames. If disabled, a repository referenced by its old name will return an error.
  • after: Returns the elements in the list that come after the specified cursor.
  • before: Returns the elements in the list that come before the specified cursor.
  • first: Returns the first n elements from the list.
  • last: Returns the last n elements from the list.
  • return_fields: Subset the return fields (as snake_case); defaults to fields listed in configs/query/*.json.
Returns:
  • A dict of the returned fields.

Classes

GitHubRepository

Interact with files stored on GitHub repositories. Methods:

aget_directory

Clones a GitHub project specified in from_path to the provided local_path; defaults to cloning the repository reference configured on the Block to the present working directory. Async version. Args:
  • from_path: If provided, interpreted as a subdirectory of the underlying repository that will be copied to the provided local path.
  • local_path: A local path to clone to; defaults to present working directory.

get_directory

Clones a GitHub project specified in from_path to the provided local_path; defaults to cloning the repository reference configured on the Block to the present working directory. Args:
  • from_path: If provided, interpreted as a subdirectory of the underlying repository that will be copied to the provided local path.
  • local_path: A local path to clone to; defaults to present working directory.