Skip to main content

page_builds

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

Overview

Namepage_builds
TypeResource
Idgithub.repos.page_builds

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
commitstring
created_atstring (date-time)
durationinteger
errorobject
pusherobjectA GitHub user. (title: Simple User)
statusstring
updated_atstring (date-time)
urlstring (uri)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_pages_buildselectowner, repo, build_idGets information about a GitHub Pages build.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
list_pages_buildsselectowner, repoper_page, pageLists builts of a GitHub Pages site.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
create_pages_deploymentinsertowner, repo, pages_build_version, oidc_tokenCreate a GitHub Pages deployment for a repository.

The authenticated user must have write permission to the repository.
request_pages_buildexecowner, repoYou can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.

Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.

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
build_idinteger
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.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

Gets information about a GitHub Pages build.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

SELECT
commit,
created_at,
duration,
error,
pusher,
status,
updated_at,
url
FROM github.repos.page_builds
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND build_id = '{{ build_id }}' -- required
;

INSERT examples

Create a GitHub Pages deployment for a repository.

The authenticated user must have write permission to the repository.

INSERT INTO github.repos.page_builds (
artifact_id,
artifact_url,
environment,
pages_build_version,
oidc_token,
owner,
repo
)
SELECT
{{ artifact_id }},
'{{ artifact_url }}',
'{{ environment }}',
'{{ pages_build_version }}' /* required */,
'{{ oidc_token }}' /* required */,
'{{ owner }}',
'{{ repo }}'
RETURNING
id,
page_url,
preview_url,
status_url
;

Lifecycle Methods

You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.

Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.

EXEC github.repos.page_builds.request_pages_build 
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required
;