pages
Creates, updates, deletes, gets or lists a pages resource.
Overview
| Name | pages |
| Type | Resource |
| Id | github.repos.pages |
Fields
The following fields are returned by SELECT queries:
- get_pages
Response
| Name | Datatype | Description |
|---|---|---|
build_type | string | The process in which the Page will be built. (legacy, workflow) (example: legacy) |
cname | string | The Pages site's custom domain (example: example.com) |
custom_404 | boolean | Whether the Page has a custom 404 page. |
html_url | string (uri) | The web address the Page can be accessed from. (example: https://example.com) |
https_certificate | object | (title: Pages Https Certificate) |
https_enforced | boolean | Whether https is enabled on the domain |
pending_domain_unverified_at | string (date-time) | The timestamp when a pending domain becomes unverified. |
protected_domain_state | string | The state if the domain is verified (pending, verified, unverified) (example: pending) |
public | boolean | Whether 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. |
source | object | (title: Pages Source Hash) |
status | string | The status of the most recent build of the Page. (built, building, errored) (example: built) |
url | string (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_pages | select | owner, repo | Gets information about a GitHub Pages site. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
create_pages_site | insert | owner, repo, source, build_type | 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. | |
update_information_about_pages_site | replace | owner, repo, build_type, source, cname, public, https_enforced | 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. | |
delete_pages_site | delete | owner, repo | 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. |
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. |
SELECT examples
- get_pages
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
- create_pages_site
- Manifest
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
;
# Description fields are for documentation purposes
- name: pages
props:
- name: owner
value: "{{ owner }}"
description: Required parameter for the pages resource.
- name: repo
value: "{{ repo }}"
description: Required parameter for the pages resource.
- name: build_type
value: "{{ build_type }}"
description: |
The process in which the Page will be built. Possible values are `"legacy"` and `"workflow"`.
valid_values: ['legacy', 'workflow']
- name: source
description: |
The source branch and directory used to publish your Pages site.
value:
branch: "{{ branch }}"
path: "{{ path }}"
REPLACE examples
- update_information_about_pages_site
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
- delete_pages_site
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
;