Skip to main content

pending_deployments_for_run

Creates, updates, deletes, gets or lists a pending_deployments_for_run resource.

Overview

Namepending_deployments_for_run
TypeResource
Idgithub.actions.pending_deployments_for_run

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
current_user_can_approvebooleanWhether the currently authenticated user can approve the deployment
environmentobject
reviewersarrayThe 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_timerintegerThe set duration of the wait timer
wait_timer_started_atstring (date-time)The time that the wait timer began. (example: 2020-11-23T22:00:40Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_pending_deployments_for_runselectowner, repo, run_idGet 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_runexecowner, repo, run_id, environment_ids, state, commentApprove 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.

NameDatatypeDescription
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
run_idintegerThe unique identifier of the workflow run.

SELECT examples

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

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 }}"
}'
;