Skip to main content

pages

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

Overview

Namepages
TypeResource
Idgithub.repos.pages

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
build_typestringThe process in which the Page will be built. (legacy, workflow) (example: legacy)
cnamestringThe Pages site's custom domain (example: example.com)
custom_404booleanWhether the Page has a custom 404 page.
html_urlstring (uri)The web address the Page can be accessed from. (example: https://example.com)
https_certificateobject (title: Pages Https Certificate)
https_enforcedbooleanWhether https is enabled on the domain
pending_domain_unverified_atstring (date-time)The timestamp when a pending domain becomes unverified.
protected_domain_statestringThe state if the domain is verified (pending, verified, unverified) (example: pending)
publicbooleanWhether the GitHub Pages site is publicly visible. If set to true, the site is accessible to anyone on the internet. If set to false, the site will only be accessible to users who have at least read access to the repository that published the site.
sourceobject (title: Pages Source Hash)
statusstringThe status of the most recent build of the Page. (built, building, errored) (example: built)
urlstring (uri)The API address for accessing this Page resource. (example: https://api.github.com/repos/github/hello-world/pages)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_pagesselectowner, repoGets information about a GitHub Pages site.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
create_pages_siteinsertowner, repo, source, build_typeConfigures a GitHub Pages site. For more information, see "About GitHub Pages."

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
update_information_about_pages_sitereplaceowner, repo, build_type, source, cname, public, https_enforcedUpdates information for a GitHub Pages site. For more information, see "About GitHub Pages.

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
delete_pages_sitedeleteowner, repoDeletes a GitHub Pages site. For more information, see "About GitHub Pages.

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

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.

SELECT examples

Gets information about a GitHub Pages site.

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

SELECT
build_type,
cname,
custom_404,
html_url,
https_certificate,
https_enforced,
pending_domain_unverified_at,
protected_domain_state,
public,
source,
status,
url
FROM github.repos.pages
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;

INSERT examples

Configures a GitHub Pages site. For more information, see "About GitHub Pages."

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

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

INSERT INTO github.repos.pages (
build_type,
source,
owner,
repo
)
SELECT
'{{ build_type }}' /* required */,
'{{ source }}' /* required */,
'{{ owner }}',
'{{ repo }}'
RETURNING
build_type,
cname,
custom_404,
html_url,
https_certificate,
https_enforced,
pending_domain_unverified_at,
protected_domain_state,
public,
source,
status,
url
;

REPLACE examples

Updates information for a GitHub Pages site. For more information, see "About GitHub Pages.

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

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

REPLACE github.repos.pages
SET
cname = '{{ cname }}',
https_enforced = {{ https_enforced }},
build_type = '{{ build_type }}',
source = '{{ source }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND build_type = '{{ build_type }}' --required
AND source = '{{ source }}' --required
AND cname = '{{ cname }}' --required
AND https_enforced = {{ https_enforced }} --required;

DELETE examples

Deletes a GitHub Pages site. For more information, see "About GitHub Pages.

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

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

DELETE FROM github.repos.pages
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
;