pending_deployments_for_run
Creates, updates, deletes, gets or lists a pending_deployments_for_run resource.
Overview
| Name | pending_deployments_for_run |
| Type | Resource |
| Id | github.actions.pending_deployments_for_run |
Fields
The following fields are returned by SELECT queries:
- get_pending_deployments_for_run
Response
| Name | Datatype | Description |
|---|---|---|
current_user_can_approve | boolean | Whether the currently authenticated user can approve the deployment |
environment | object | |
reviewers | array | The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. |
wait_timer | integer | The set duration of the wait timer |
wait_timer_started_at | string (date-time) | The time that the wait timer began. (example: 2020-11-23T22:00:40Z) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_pending_deployments_for_run | select | owner, repo, run_id | Get all deployment environments for a workflow run that are waiting for protection rules to pass. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
review_pending_deployments_for_run | exec | owner, repo, run_id, environment_ids, state, comment | Approve or reject pending deployments that are waiting on approval by a required reviewer. Required reviewers with read access to the repository contents and deployments can use this endpoint. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
run_id | integer | The unique identifier of the workflow run. |
SELECT examples
- get_pending_deployments_for_run
Get all deployment environments for a workflow run that are waiting for protection rules to pass.
Anyone with read access to the repository can use this endpoint.
If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
SELECT
current_user_can_approve,
environment,
reviewers,
wait_timer,
wait_timer_started_at
FROM github.actions.pending_deployments_for_run
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND run_id = '{{ run_id }}' -- required
;
Lifecycle Methods
- review_pending_deployments_for_run
Approve or reject pending deployments that are waiting on approval by a required reviewer.
Required reviewers with read access to the repository contents and deployments can use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
EXEC github.actions.pending_deployments_for_run.review_pending_deployments_for_run
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@run_id='{{ run_id }}' --required
@@json=
'{
"environment_ids": "{{ environment_ids }}",
"state": "{{ state }}",
"comment": "{{ comment }}"
}'
;