Skip to content

feat: octokit.rest.repos.getPagesHealthCheck() #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions docs/repos/getPagesHealthCheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Get a DNS health check for GitHub Pages
example: octokit.rest.repos.getPagesHealthCheck({ owner, repo })
route: GET /repos/{owner}/{repo}/pages/health
scope: repos
type: API method
---

# Get a DNS health check for GitHub Pages

Gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages.

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.

Users must have admin or owner permissions. GitHub Apps must have the `pages:write` and `administration:write` permission to use this endpoint.

```js
octokit.rest.repos.getPagesHealthCheck({
owner,
repo,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>owner</td><td>yes</td><td>

</td></tr>
<tr><td>repo</td><td>yes</td><td>

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/repos#get-a-dns-health-check-for-github-pages).
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"dependencies": {
"@octokit/types": "^6.13.2",
"@octokit/types": "^6.14.0",
"deprecation": "^2.3.1"
},
"devDependencies": {
Expand Down
69 changes: 67 additions & 2 deletions scripts/update-endpoints/generated/endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -11282,7 +11282,7 @@
"description": "Response",
"examples": [
{
"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\":\"\"}"
"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\":\"\"}"
}
]
},
Expand Down Expand Up @@ -11747,7 +11747,7 @@
"description": "Response",
"examples": [
{
"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\":\"\"}]"
"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\":\"\"}]"
}
]
},
Expand Down Expand Up @@ -39478,6 +39478,71 @@
],
"renamed": null
},
{
"name": "Get a DNS health check for GitHub Pages",
"scope": "repos",
"id": "getPagesHealthCheck",
"method": "GET",
"url": "/repos/{owner}/{repo}/pages/health",
"isDeprecated": false,
"deprecationDate": null,
"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.",
"documentationUrl": "https://docs.github.com/rest/reference/repos#get-a-dns-health-check-for-github-pages",
"previews": [],
"headers": [],
"parameters": [
{
"name": "owner",
"description": "",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "repo",
"description": "",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "Response",
"examples": [
{
"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}}"
}
]
},
{ "code": 202, "description": "Empty response", "examples": null },
{
"code": 400,
"description": "Custom domains are not available for GitHub Pages",
"examples": null
},
{ "code": 404, "description": "Resource not found", "examples": null },
{
"code": 422,
"description": "There isn't a CNAME for this page",
"examples": null
}
],
"renamed": null
},
{
"name": "Get the weekly commit count",
"scope": "repos",
Expand Down
1 change: 1 addition & 0 deletions src/generated/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,7 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
getPages: ["GET /repos/{owner}/{repo}/pages"],
getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
getPullRequestReviewProtection: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews",
Expand Down
16 changes: 16 additions & 0 deletions src/generated/method-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6887,6 +6887,22 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages.
*
* 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.
*
* Users must have admin or owner permissions. GitHub Apps must have the `pages:write` and `administration:write` permission to use this endpoint.
*/
getPagesHealthCheck: {
(
params?: RestEndpointMethodTypes["repos"]["getPagesHealthCheck"]["parameters"]
): Promise<
RestEndpointMethodTypes["repos"]["getPagesHealthCheck"]["response"]
>;
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* 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`.
*
Expand Down
8 changes: 8 additions & 0 deletions src/generated/parameters-and-response-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4026,6 +4026,14 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["GET /repos/{owner}/{repo}/pages/builds/{build_id}"]["response"];
};
getPagesHealthCheck: {
parameters: RequestParameters &
Omit<
Endpoints["GET /repos/{owner}/{repo}/pages/health"]["parameters"],
"baseUrl" | "headers" | "mediaType"
>;
response: Endpoints["GET /repos/{owner}/{repo}/pages/health"]["response"];
};
getParticipationStats: {
parameters: RequestParameters &
Omit<
Expand Down