gitea.actions.async_actions
async_actions
Asynchronous Gitea Actions resource.
The asynchronous mirror of gitea.actions.actions, which is the module to read
for what the resource covers and where each family of endpoints lives.
Classes
gitea.actions.async_actions.AsyncActions
Bases: AsyncRunManagement, AsyncArtifacts, AsyncSecrets, AsyncVariables, AsyncRunners, BaseActions, AsyncResource
Asynchronous Gitea Actions resource.
Source code in src/gitea/resource/async_resource.py
Methods:
gitea.actions.async_actions.AsyncActions.list_workflows
async
list_workflows(
owner: str, repository: str, **kwargs: Any
) -> tuple[dict[str, Any], dict[str, Any]]
List the workflows of a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A tuple containing the listing - an object carrying |
dict[str, Any]
|
and |
tuple[dict[str, Any], dict[str, Any]]
|
with metadata. |
Source code in src/gitea/actions/async_actions.py
gitea.actions.async_actions.AsyncActions.get_workflow
async
get_workflow(
owner: str,
repository: str,
workflow_id: str,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Get one workflow of a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
workflow_id
|
str
|
The workflow's file name, such as |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A tuple containing the workflow as a dictionary and a dictionary |
dict[str, Any]
|
with metadata. |
Source code in src/gitea/actions/async_actions.py
gitea.actions.async_actions.AsyncActions.dispatch_workflow
async
dispatch_workflow(
owner: str,
repository: str,
workflow_id: str,
ref: str,
inputs: dict[str, str] | None = None,
return_run_details: bool | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Start a workflow run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
workflow_id
|
str
|
The workflow's file name, such as |
required |
ref
|
str
|
The branch or tag to run the workflow on. |
required |
inputs
|
dict[str, str] | None
|
The |
None
|
return_run_details
|
bool | None
|
Whether to ask the response to identify the run that was started. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A tuple containing the run details - |
dict[str, Any]
|
and |
tuple[dict[str, Any], dict[str, Any]]
|
them, an empty dictionary otherwise, and a dictionary with metadata. |
tuple[dict[str, Any], dict[str, Any]]
|
The endpoint answers |
tuple[dict[str, Any], dict[str, Any]]
|
|
tuple[dict[str, Any], dict[str, Any]]
|
status is a dispatch that was accepted rather than one that failed. |
Source code in src/gitea/actions/async_actions.py
gitea.actions.async_actions.AsyncActions.list_workflow_runs
async
list_workflow_runs(
owner: str | None = None,
repository: str | None = None,
workflow_id: str | None = None,
admin: bool = False,
event: str | None = None,
branch: str | None = None,
status: str | None = None,
actor: str | None = None,
head_sha: str | None = None,
exclude_pull_requests: bool | None = None,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
List the workflow runs of a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str | None
|
The owner of the repository, or the organization whose runs are listed. |
None
|
repository
|
str | None
|
The name of the repository, to list its runs alone. Omitting it lists the organization's runs, and omitting both lists the authenticated account's. |
None
|
workflow_id
|
str | None
|
The workflow's file name, to list its runs alone. Only a repository's runs can be narrowed to one workflow. |
None
|
admin
|
bool
|
Whether to list the runs of the whole instance, which answers only to an administrator's token. |
False
|
event
|
str | None
|
The event that triggered the run. |
None
|
branch
|
str | None
|
The branch the run is on. |
None
|
status
|
str | None
|
The status of the runs to list. |
None
|
actor
|
str | None
|
The user who triggered the run. |
None
|
head_sha
|
str | None
|
The commit the run was triggered for. |
None
|
exclude_pull_requests
|
bool | None
|
Whether to leave each run's
|
None
|
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of runs per page. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A tuple containing the listing - an object carrying |
dict[str, Any]
|
and |
tuple[dict[str, Any], dict[str, Any]]
|
with metadata. |
Source code in src/gitea/actions/async_actions.py
gitea.actions.async_actions.AsyncActions.get_workflow_run
async
get_workflow_run(
owner: str, repository: str, run_id: int, **kwargs: Any
) -> tuple[dict[str, Any], dict[str, Any]]
Get one workflow run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
run_id
|
int
|
The ID of the run. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A tuple containing the run as a dictionary - its |
dict[str, Any]
|
|
tuple[dict[str, Any], dict[str, Any]]
|
metadata. |
Source code in src/gitea/actions/async_actions.py
gitea.actions.async_actions.AsyncActions.list_workflow_run_jobs
async
list_workflow_run_jobs(
owner: str,
repository: str,
run_id: int,
status: str | None = None,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
List the jobs of a workflow run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
run_id
|
int
|
The ID of the run. |
required |
status
|
str | None
|
The status of the jobs to list. |
None
|
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of jobs per page. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A tuple containing the listing - an object carrying |
dict[str, Any]
|
and |
tuple[dict[str, Any], dict[str, Any]]
|
metadata. |
Source code in src/gitea/actions/async_actions.py
gitea.actions.async_actions.AsyncActions.list_workflow_jobs
async
list_workflow_jobs(
owner: str | None = None,
repository: str | None = None,
admin: bool = False,
status: str | None = None,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
List the jobs of a whole scope, rather than of one run.
This is a different endpoint from list_workflow_run_jobs, and the
difference is what makes it useful: it answers with every job of the
scope, so status="queued" finds the jobs that are waiting for a runner
without walking the runs to reach them. Asking one run for its jobs is
still the way to see how that run went.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str | None
|
The owner of the repository, or the organization whose jobs
are listed. Omitting both this and |
None
|
repository
|
str | None
|
The name of the repository, to list its jobs alone. |
None
|
admin
|
bool
|
Whether to list the jobs of the whole instance, which answers only to an administrator's token. |
False
|
status
|
str | None
|
The status of the jobs to list: |
None
|
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of jobs per page. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A tuple containing the listing - an object carrying |
dict[str, Any]
|
|
Source code in src/gitea/actions/async_actions.py
gitea.actions.async_actions.AsyncActions.get_workflow_job
async
get_workflow_job(
owner: str, repository: str, job_id: int, **kwargs: Any
) -> tuple[dict[str, Any], dict[str, Any]]
Get one job of a workflow run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
job_id
|
int
|
The ID of the job. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A tuple containing the job as a dictionary - including its |
dict[str, Any]
|
each with a |
tuple[dict[str, Any], dict[str, Any]]
|
dictionary with metadata. |
Source code in src/gitea/actions/async_actions.py
gitea.actions.async_actions.AsyncActions.get_workflow_job_logs
async
get_workflow_job_logs(
owner: str, repository: str, job_id: int, **kwargs: Any
) -> tuple[str, dict[str, Any]]
Download the logs of one job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
job_id
|
int
|
The ID of the job. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
str
|
A tuple containing the log text and a dictionary with metadata. The |
dict[str, Any]
|
endpoint answers with the log itself rather than with a JSON |
tuple[str, dict[str, Any]]
|
document, so this is the one method here handing back text; a job |
tuple[str, dict[str, Any]]
|
that has produced no output yet answers with an empty string. |