Skip to content

Commit 39f4f14

Browse files
authored
feat: octokit.rest.repos.getPagesHealthCheck() (#382)
1 parent 18a1c8e commit 39f4f14

File tree

7 files changed

+144
-10
lines changed

7 files changed

+144
-10
lines changed

docs/repos/getPagesHealthCheck.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Get a DNS health check for GitHub Pages
3+
example: octokit.rest.repos.getPagesHealthCheck({ owner, repo })
4+
route: GET /repos/{owner}/{repo}/pages/health
5+
scope: repos
6+
type: API method
7+
---
8+
9+
# Get a DNS health check for GitHub Pages
10+
11+
Gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages.
12+
13+
The first request to this endpoint returns a `202 Accepted` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a `200 OK` status with the health check results in the response.
14+
15+
Users must have admin or owner permissions. GitHub Apps must have the `pages:write` and `administration:write` permission to use this endpoint.
16+
17+
```js
18+
octokit.rest.repos.getPagesHealthCheck({
19+
owner,
20+
repo,
21+
});
22+
```
23+
24+
## Parameters
25+
26+
<table>
27+
<thead>
28+
<tr>
29+
<th>name</th>
30+
<th>required</th>
31+
<th>description</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>owner</td><td>yes</td><td>
36+
37+
</td></tr>
38+
<tr><td>repo</td><td>yes</td><td>
39+
40+
</td></tr>
41+
</tbody>
42+
</table>
43+
44+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/repos#get-a-dns-health-check-for-github-pages).

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"author": "Gregor Martynus (https://twitter.com/gr2m)",
2525
"license": "MIT",
2626
"dependencies": {
27-
"@octokit/types": "^6.13.2",
27+
"@octokit/types": "^6.14.0",
2828
"deprecation": "^2.3.1"
2929
},
3030
"devDependencies": {

scripts/update-endpoints/generated/endpoints.json

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11282,7 +11282,7 @@
1128211282
"description": "Response",
1128311283
"examples": [
1128411284
{
11285-
"data": "{\"ref\":\"refs/heads/main\",\"commit_sha\":\"c18c69115654ff0166991962832dc2bd7756e655\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:analyze\",\"environment\":\"{\\\"language\\\":\\\"javascript\\\"}\",\"error\":\"\",\"created_at\":\"2021-01-13T11:55:49Z\",\"results_count\":3,\"rules_count\":67,\"id\":3602840,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201\",\"sarif_id\":\"47177e22-5596-11eb-80a1-c1e54ef945c6\",\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"deletable\":true,\"warning\":\"\"}"
11285+
"data": "{\"ref\":\"refs/heads/main\",\"commit_sha\":\"c18c69115654ff0166991962832dc2bd7756e655\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:analyze\",\"environment\":\"{\\\"language\\\":\\\"javascript\\\"}\",\"error\":\"\",\"category\":\".github/workflows/codeql-analysis.yml:analyze/language:javascript\",\"created_at\":\"2021-01-13T11:55:49Z\",\"results_count\":3,\"rules_count\":67,\"id\":3602840,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201\",\"sarif_id\":\"47177e22-5596-11eb-80a1-c1e54ef945c6\",\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"deletable\":true,\"warning\":\"\"}"
1128611286
}
1128711287
]
1128811288
},
@@ -11747,7 +11747,7 @@
1174711747
"description": "Response",
1174811748
"examples": [
1174911749
{
11750-
"data": "[{\"ref\":\"refs/heads/main\",\"commit_sha\":\"d99612c3e1f2970085cfbaeadf8f010ef69bad83\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:analyze\",\"environment\":\"{\\\"language\\\":\\\"python\\\"}\",\"error\":\"\",\"created_at\":\"2020-08-27T15:05:21Z\",\"results_count\":17,\"rules_count\":49,\"id\":201,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201\",\"sarif_id\":\"6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53\",\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"deletable\":true,\"warning\":\"\"},{\"ref\":\"refs/heads/my-branch\",\"commit_sha\":\"c8cff6510d4d084fb1b4aa13b64b97ca12b07321\",\"analysis_key\":\".github/workflows/shiftleft.yml:build\",\"environment\":\"{}\",\"error\":\"\",\"created_at\":\"2020-08-31T22:46:44Z\",\"results_count\":17,\"rules_count\":32,\"id\":200,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/200\",\"sarif_id\":\"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\",\"tool\":{\"name\":\"Python Security Analysis\",\"guid\":null,\"version\":\"1.2.0\"},\"deletable\":true,\"warning\":\"\"}]"
11750+
"data": "[{\"ref\":\"refs/heads/main\",\"commit_sha\":\"d99612c3e1f2970085cfbaeadf8f010ef69bad83\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:analyze\",\"environment\":\"{\\\"language\\\":\\\"python\\\"}\",\"error\":\"\",\"category\":\".github/workflows/codeql-analysis.yml:analyze/language:python\",\"created_at\":\"2020-08-27T15:05:21Z\",\"results_count\":17,\"rules_count\":49,\"id\":201,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201\",\"sarif_id\":\"6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53\",\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"deletable\":true,\"warning\":\"\"},{\"ref\":\"refs/heads/my-branch\",\"commit_sha\":\"c8cff6510d4d084fb1b4aa13b64b97ca12b07321\",\"analysis_key\":\".github/workflows/shiftleft.yml:build\",\"environment\":\"{}\",\"error\":\"\",\"category\":\".github/workflows/shiftleft.yml:build/\",\"created_at\":\"2020-08-31T22:46:44Z\",\"results_count\":17,\"rules_count\":32,\"id\":200,\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/200\",\"sarif_id\":\"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\",\"tool\":{\"name\":\"Python Security Analysis\",\"guid\":null,\"version\":\"1.2.0\"},\"deletable\":true,\"warning\":\"\"}]"
1175111751
}
1175211752
]
1175311753
},
@@ -39478,6 +39478,71 @@
3947839478
],
3947939479
"renamed": null
3948039480
},
39481+
{
39482+
"name": "Get a DNS health check for GitHub Pages",
39483+
"scope": "repos",
39484+
"id": "getPagesHealthCheck",
39485+
"method": "GET",
39486+
"url": "/repos/{owner}/{repo}/pages/health",
39487+
"isDeprecated": false,
39488+
"deprecationDate": null,
39489+
"description": "Gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages.\n\nThe first request to this endpoint returns a `202 Accepted` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a `200 OK` status with the health check results in the response.\n\nUsers must have admin or owner permissions. GitHub Apps must have the `pages:write` and `administration:write` permission to use this endpoint.",
39490+
"documentationUrl": "https://docs.github.com/rest/reference/repos#get-a-dns-health-check-for-github-pages",
39491+
"previews": [],
39492+
"headers": [],
39493+
"parameters": [
39494+
{
39495+
"name": "owner",
39496+
"description": "",
39497+
"in": "PATH",
39498+
"type": "string",
39499+
"required": true,
39500+
"enum": null,
39501+
"allowNull": false,
39502+
"mapToData": null,
39503+
"validation": null,
39504+
"alias": null,
39505+
"deprecated": null
39506+
},
39507+
{
39508+
"name": "repo",
39509+
"description": "",
39510+
"in": "PATH",
39511+
"type": "string",
39512+
"required": true,
39513+
"enum": null,
39514+
"allowNull": false,
39515+
"mapToData": null,
39516+
"validation": null,
39517+
"alias": null,
39518+
"deprecated": null
39519+
}
39520+
],
39521+
"responses": [
39522+
{
39523+
"code": 200,
39524+
"description": "Response",
39525+
"examples": [
39526+
{
39527+
"data": "{\"domain\":{\"host\":\"example.com\",\"uri\":\"http://example.com/\",\"nameservers\":\"default\",\"dns_resolves\":true,\"is_proxied\":false,\"is_cloudflare_ip\":false,\"is_fastly_ip\":false,\"is_old_ip_address\":false,\"is_a_record\":true,\"has_cname_record\":false,\"has_mx_records_present\":false,\"is_valid_domain\":true,\"is_apex_domain\":true,\"should_be_a_record\":true,\"is_cname_to_github_user_domain\":false,\"is_cname_to_pages_dot_github_dot_com\":false,\"is_cname_to_fastly\":false,\"is_pointed_to_github_pages_ip\":true,\"is_non_github_pages_ip_present\":false,\"is_pages_domain\":false,\"is_served_by_pages\":true,\"is_valid\":true,\"reason\":null,\"responds_to_https\":true,\"enforces_https\":true,\"https_error\":null,\"is_https_eligible\":true,\"caa_error\":null},\"alt_domain\":{\"host\":\"www.example.com\",\"uri\":\"http://www.example.com/\",\"nameservers\":\"default\",\"dns_resolves\":true,\"is_proxied\":false,\"is_cloudflare_ip\":false,\"is_fastly_ip\":false,\"is_old_ip_address\":false,\"is_a_record\":true,\"has_cname_record\":false,\"has_mx_records_present\":false,\"is_valid_domain\":true,\"is_apex_domain\":true,\"should_be_a_record\":true,\"is_cname_to_github_user_domain\":false,\"is_cname_to_pages_dot_github_dot_com\":false,\"is_cname_to_fastly\":false,\"is_pointed_to_github_pages_ip\":true,\"is_non_github_pages_ip_present\":false,\"is_pages_domain\":false,\"is_served_by_pages\":true,\"is_valid\":true,\"reason\":null,\"responds_to_https\":true,\"enforces_https\":true,\"https_error\":null,\"is_https_eligible\":true,\"caa_error\":null}}"
39528+
}
39529+
]
39530+
},
39531+
{ "code": 202, "description": "Empty response", "examples": null },
39532+
{
39533+
"code": 400,
39534+
"description": "Custom domains are not available for GitHub Pages",
39535+
"examples": null
39536+
},
39537+
{ "code": 404, "description": "Resource not found", "examples": null },
39538+
{
39539+
"code": 422,
39540+
"description": "There isn't a CNAME for this page",
39541+
"examples": null
39542+
}
39543+
],
39544+
"renamed": null
39545+
},
3948139546
{
3948239547
"name": "Get the weekly commit count",
3948339548
"scope": "repos",

src/generated/endpoints.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,7 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
11201120
getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
11211121
getPages: ["GET /repos/{owner}/{repo}/pages"],
11221122
getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
1123+
getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
11231124
getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
11241125
getPullRequestReviewProtection: [
11251126
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews",

src/generated/method-types.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6887,6 +6887,22 @@ export type RestEndpointMethods = {
68876887
defaults: RequestInterface["defaults"];
68886888
endpoint: EndpointInterface<{ url: string }>;
68896889
};
6890+
/**
6891+
* Gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages.
6892+
*
6893+
* The first request to this endpoint returns a `202 Accepted` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a `200 OK` status with the health check results in the response.
6894+
*
6895+
* Users must have admin or owner permissions. GitHub Apps must have the `pages:write` and `administration:write` permission to use this endpoint.
6896+
*/
6897+
getPagesHealthCheck: {
6898+
(
6899+
params?: RestEndpointMethodTypes["repos"]["getPagesHealthCheck"]["parameters"]
6900+
): Promise<
6901+
RestEndpointMethodTypes["repos"]["getPagesHealthCheck"]["response"]
6902+
>;
6903+
defaults: RequestInterface["defaults"];
6904+
endpoint: EndpointInterface<{ url: string }>;
6905+
};
68906906
/**
68916907
* Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`.
68926908
*

src/generated/parameters-and-response-types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4026,6 +4026,14 @@ export type RestEndpointMethodTypes = {
40264026
>;
40274027
response: Endpoints["GET /repos/{owner}/{repo}/pages/builds/{build_id}"]["response"];
40284028
};
4029+
getPagesHealthCheck: {
4030+
parameters: RequestParameters &
4031+
Omit<
4032+
Endpoints["GET /repos/{owner}/{repo}/pages/health"]["parameters"],
4033+
"baseUrl" | "headers" | "mediaType"
4034+
>;
4035+
response: Endpoints["GET /repos/{owner}/{repo}/pages/health"]["response"];
4036+
};
40294037
getParticipationStats: {
40304038
parameters: RequestParameters &
40314039
Omit<

0 commit comments

Comments
 (0)