Skip to content

Commit 169375d

Browse files
authored
fix: update docs for repos.createUsingTemplate to clarify that it doesn't require special permissions with a public repo (#544)
WIP octokit/openapi updated
1 parent 0c9a805 commit 169375d

File tree

4 files changed

+35
-18
lines changed

4 files changed

+35
-18
lines changed

docs/repos/createAutolink.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,17 @@ The name of the repository. The name is not case sensitive.
4242
</td></tr>
4343
<tr><td>key_prefix</td><td>yes</td><td>
4444

45-
The prefix appended by alphanumeric characters will generate a link any time it is found in an issue, pull request, or commit.
45+
This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit.
4646

4747
</td></tr>
4848
<tr><td>url_template</td><td>yes</td><td>
4949

50-
The URL must contain `<num>` for the reference number. `<num>` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`.
50+
The URL must contain `<num>` for the reference number. `<num>` matches different characters depending on the value of `is_alphanumeric`.
51+
52+
</td></tr>
53+
<tr><td>is_alphanumeric</td><td>no</td><td>
54+
55+
Whether this autolink reference matches alphanumeric characters. If true, the `<num>` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If false, this autolink reference only matches numeric characters.
5156

5257
</td></tr>
5358
</tbody>

docs/repos/createUsingTemplate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type: API method
88

99
# Create a repository using a template
1010

11-
Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.
11+
Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.
1212

1313
**OAuth scope requirements**
1414

scripts/update-endpoints/generated/endpoints.json

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13898,7 +13898,7 @@
1389813898
"description": "Response",
1389913899
"examples": [
1390013900
{
13901-
"data": "{\"number\":42,\"created_at\":\"2020-06-19T11:21:34Z\",\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42\",\"html_url\":\"https://github.com/octocat/hello-world/code-scanning/42\",\"state\":\"dismissed\",\"fixed_at\":null,\"dismissed_by\":{\"login\":\"octocat\",\"id\":54933897,\"node_id\":\"MDQ6VXNlcjE=\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/octocat\",\"html_url\":\"https://github.com/octocat\",\"followers_url\":\"https://api.github.com/users/octocat/followers\",\"following_url\":\"https://api.github.com/users/octocat/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/octocat/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/octocat/subscriptions\",\"organizations_url\":\"https://api.github.com/users/octocat/orgs\",\"repos_url\":\"https://api.github.com/users/octocat/repos\",\"events_url\":\"https://api.github.com/users/octocat/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/octocat/received_events\",\"type\":\"User\",\"site_admin\":false},\"dismissed_at\":\"2020-02-14T12:29:18Z\",\"dismissed_reason\":\"false positive\",\"dismissed_comment\":\"This alert is not actually correct, because there's a sanitizer included in the library.\",\"rule\":{\"id\":\"js/zipslip\",\"severity\":\"error\",\"security_severity_level\":\"high\",\"description\":\"Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\",\"name\":\"js/zipslip\",\"full_description\":\"Extracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten.\",\"tags\":[\"security\",\"external/cwe/cwe-022\"],\"help\":\"# Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\\\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ...\"},\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"most_recent_instance\":{\"ref\":\"refs/heads/main\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:CodeQL-Build\",\"environment\":\"{}\",\"state\":\"dismissed\",\"commit_sha\":\"39406e42cb832f683daa691dd652a8dc36ee8930\",\"message\":{\"text\":\"This path depends on a user-provided value.\"},\"location\":{\"path\":\"spec-main/api-session-spec.ts\",\"start_line\":917,\"end_line\":917,\"start_column\":7,\"end_column\":18},\"classifications\":[\"test\"]},\"instances_url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42/instances\"}"
13901+
"data": "{\"number\":42,\"created_at\":\"2020-06-19T11:21:34Z\",\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42\",\"html_url\":\"https://github.com/octocat/hello-world/code-scanning/42\",\"state\":\"dismissed\",\"fixed_at\":null,\"dismissed_by\":{\"login\":\"octocat\",\"id\":54933897,\"node_id\":\"MDQ6VXNlcjE=\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/octocat\",\"html_url\":\"https://github.com/octocat\",\"followers_url\":\"https://api.github.com/users/octocat/followers\",\"following_url\":\"https://api.github.com/users/octocat/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/octocat/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/octocat/subscriptions\",\"organizations_url\":\"https://api.github.com/users/octocat/orgs\",\"repos_url\":\"https://api.github.com/users/octocat/repos\",\"events_url\":\"https://api.github.com/users/octocat/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/octocat/received_events\",\"type\":\"User\",\"site_admin\":false},\"dismissed_at\":\"2020-02-14T12:29:18Z\",\"dismissed_reason\":\"false positive\",\"dismissed_comment\":\"This alert is not actually correct, because there's a sanitizer included in the library.\",\"rule\":{\"id\":\"js/zipslip\",\"severity\":\"error\",\"security_severity_level\":\"high\",\"description\":\"Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\",\"name\":\"js/zipslip\",\"full_description\":\"Extracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten.\",\"tags\":[\"security\",\"external/cwe/cwe-022\"],\"help\":\"# Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\\\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ...\",\"help_uri\":\"https://codeql.github.com/\"},\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"most_recent_instance\":{\"ref\":\"refs/heads/main\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:CodeQL-Build\",\"environment\":\"{}\",\"state\":\"dismissed\",\"commit_sha\":\"39406e42cb832f683daa691dd652a8dc36ee8930\",\"message\":{\"text\":\"This path depends on a user-provided value.\"},\"location\":{\"path\":\"spec-main/api-session-spec.ts\",\"start_line\":917,\"end_line\":917,\"start_column\":7,\"end_column\":18},\"classifications\":[\"test\"]},\"instances_url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42/instances\"}"
1390213902
}
1390313903
]
1390413904
},
@@ -15065,7 +15065,7 @@
1506515065
"description": "Response",
1506615066
"examples": [
1506715067
{
15068-
"data": "{\"number\":42,\"created_at\":\"2020-08-25T21:28:36Z\",\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42\",\"html_url\":\"https://github.com/octocat/hello-world/code-scanning/42\",\"state\":\"dismissed\",\"fixed_at\":null,\"dismissed_by\":{\"login\":\"octocat\",\"id\":1,\"node_id\":\"MDQ6VXNlcjE=\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/octocat\",\"html_url\":\"https://github.com/octocat\",\"followers_url\":\"https://api.github.com/users/octocat/followers\",\"following_url\":\"https://api.github.com/users/octocat/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/octocat/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/octocat/subscriptions\",\"organizations_url\":\"https://api.github.com/users/octocat/orgs\",\"repos_url\":\"https://api.github.com/users/octocat/repos\",\"events_url\":\"https://api.github.com/users/octocat/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/octocat/received_events\",\"type\":\"User\",\"site_admin\":false},\"dismissed_at\":\"2020-09-02T22:34:56Z\",\"dismissed_reason\":\"false positive\",\"dismissed_comment\":\"This alert is not actually correct, because there's a sanitizer included in the library.\",\"rule\":{\"id\":\"js/zipslip\",\"severity\":\"error\",\"security_severity_level\":\"high\",\"description\":\"Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\",\"name\":\"js/zipslip\",\"full_description\":\"Extracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten.\",\"tags\":[\"security\",\"external/cwe/cwe-022\"],\"help\":\"# Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\\\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ...\"},\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"most_recent_instance\":{\"ref\":\"refs/heads/main\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:CodeQL-Build\",\"environment\":\"{}\",\"state\":\"dismissed\",\"commit_sha\":\"39406e42cb832f683daa691dd652a8dc36ee8930\",\"message\":{\"text\":\"This path depends on a user-provided value.\"},\"location\":{\"path\":\"spec-main/api-session-spec.ts\",\"start_line\":917,\"end_line\":917,\"start_column\":7,\"end_column\":18},\"classifications\":[\"test\"]},\"instances_url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42/instances\"}"
15068+
"data": "{\"number\":42,\"created_at\":\"2020-08-25T21:28:36Z\",\"url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42\",\"html_url\":\"https://github.com/octocat/hello-world/code-scanning/42\",\"state\":\"dismissed\",\"fixed_at\":null,\"dismissed_by\":{\"login\":\"octocat\",\"id\":1,\"node_id\":\"MDQ6VXNlcjE=\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/octocat\",\"html_url\":\"https://github.com/octocat\",\"followers_url\":\"https://api.github.com/users/octocat/followers\",\"following_url\":\"https://api.github.com/users/octocat/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/octocat/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/octocat/subscriptions\",\"organizations_url\":\"https://api.github.com/users/octocat/orgs\",\"repos_url\":\"https://api.github.com/users/octocat/repos\",\"events_url\":\"https://api.github.com/users/octocat/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/octocat/received_events\",\"type\":\"User\",\"site_admin\":false},\"dismissed_at\":\"2020-09-02T22:34:56Z\",\"dismissed_reason\":\"false positive\",\"dismissed_comment\":\"This alert is not actually correct, because there's a sanitizer included in the library.\",\"rule\":{\"id\":\"js/zipslip\",\"severity\":\"error\",\"security_severity_level\":\"high\",\"description\":\"Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\",\"name\":\"js/zipslip\",\"full_description\":\"Extracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten.\",\"tags\":[\"security\",\"external/cwe/cwe-022\"],\"help\":\"# Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\\\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ...\",\"help_uri\":\"https://codeql.github.com/\"},\"tool\":{\"name\":\"CodeQL\",\"guid\":null,\"version\":\"2.4.0\"},\"most_recent_instance\":{\"ref\":\"refs/heads/main\",\"analysis_key\":\".github/workflows/codeql-analysis.yml:CodeQL-Build\",\"environment\":\"{}\",\"state\":\"dismissed\",\"commit_sha\":\"39406e42cb832f683daa691dd652a8dc36ee8930\",\"message\":{\"text\":\"This path depends on a user-provided value.\"},\"location\":{\"path\":\"spec-main/api-session-spec.ts\",\"start_line\":917,\"end_line\":917,\"start_column\":7,\"end_column\":18},\"classifications\":[\"test\"]},\"instances_url\":\"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42/instances\"}"
1506915069
}
1507015070
]
1507115071
},
@@ -30821,11 +30821,6 @@
3082130821
}
3082230822
]
3082330823
},
30824-
{
30825-
"code": 302,
30826-
"description": "Response if requester is not an organization member",
30827-
"examples": null
30828-
},
3082930824
{ "code": 422, "description": "Validation failed", "examples": null }
3083030825
],
3083130826
"renamed": null
@@ -37287,7 +37282,8 @@
3728737282
},
3728837283
{ "code": 304, "description": "Not modified", "examples": null },
3728937284
{ "code": 404, "description": "Resource not found", "examples": null },
37290-
{ "code": 500, "description": "Internal Error", "examples": null }
37285+
{ "code": 500, "description": "Internal Error", "examples": null },
37286+
{ "code": 503, "description": "Service unavailable", "examples": null }
3729137287
],
3729237288
"renamed": null
3729337289
},
@@ -37878,7 +37874,8 @@
3787837874
]
3787937875
},
3788037876
{ "code": 422, "description": "Validation failed", "examples": null },
37881-
{ "code": 500, "description": "Internal Error", "examples": null }
37877+
{ "code": 500, "description": "Internal Error", "examples": null },
37878+
{ "code": 503, "description": "Service unavailable", "examples": null }
3788237879
],
3788337880
"renamed": null
3788437881
},
@@ -42432,7 +42429,8 @@
4243242429
]
4243342430
},
4243442431
{ "code": 404, "description": "Resource not found", "examples": null },
42435-
{ "code": 500, "description": "Internal Error", "examples": null }
42432+
{ "code": 500, "description": "Internal Error", "examples": null },
42433+
{ "code": 503, "description": "Service unavailable", "examples": null }
4243642434
],
4243742435
"renamed": null
4243842436
},
@@ -42478,7 +42476,7 @@
4247842476
},
4247942477
{
4248042478
"name": "key_prefix",
42481-
"description": "The prefix appended by alphanumeric characters will generate a link any time it is found in an issue, pull request, or commit.",
42479+
"description": "This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit.",
4248242480
"in": "BODY",
4248342481
"type": "string",
4248442482
"required": true,
@@ -42491,7 +42489,7 @@
4249142489
},
4249242490
{
4249342491
"name": "url_template",
42494-
"description": "The URL must contain `<num>` for the reference number. `<num>` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`.",
42492+
"description": "The URL must contain `<num>` for the reference number. `<num>` matches different characters depending on the value of `is_alphanumeric`.",
4249542493
"in": "BODY",
4249642494
"type": "string",
4249742495
"required": true,
@@ -42501,6 +42499,19 @@
4250142499
"validation": null,
4250242500
"alias": null,
4250342501
"deprecated": null
42502+
},
42503+
{
42504+
"name": "is_alphanumeric",
42505+
"description": "Whether this autolink reference matches alphanumeric characters. If true, the `<num>` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If false, this autolink reference only matches numeric characters.",
42506+
"in": "BODY",
42507+
"type": "boolean",
42508+
"required": false,
42509+
"enum": null,
42510+
"allowNull": false,
42511+
"mapToData": null,
42512+
"validation": null,
42513+
"alias": null,
42514+
"deprecated": null
4250442515
}
4250542516
],
4250642517
"responses": [
@@ -45070,7 +45081,7 @@
4507045081
"isDeprecated": false,
4507145082
"deprecationDate": null,
4507245083
"removalDate": null,
45073-
"description": "Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.\n\n**OAuth scope requirements**\n\nWhen using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n* `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n* `repo` scope to create a private repository",
45084+
"description": "Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.\n\n**OAuth scope requirements**\n\nWhen using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n* `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n* `repo` scope to create a private repository",
4507445085
"documentationUrl": "https://docs.github.com/rest/reference/repos#create-a-repository-using-a-template",
4507545086
"previews": [],
4507645087
"headers": [],
@@ -48380,7 +48391,8 @@
4838048391
},
4838148392
{ "code": 404, "description": "Resource not found", "examples": null },
4838248393
{ "code": 422, "description": "Validation failed", "examples": null },
48383-
{ "code": 500, "description": "Internal Error", "examples": null }
48394+
{ "code": 500, "description": "Internal Error", "examples": null },
48395+
{ "code": 503, "description": "Service unavailable", "examples": null }
4838448396
],
4838548397
"renamed": null
4838648398
},

0 commit comments

Comments
 (0)