Skip to content

Commit dd176ff

Browse files
authored
feat: .rest.repos.createAutolink(), .rest.repos.listAutolinks(), .rest.repos.getAutolink(), .rest.repos.deleteAutolink() (#427)
1 parent 5fb8342 commit dd176ff

File tree

10 files changed

+561
-8
lines changed

10 files changed

+561
-8
lines changed

docs/repos/createAutolink.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: Create an autolink reference for a repository
3+
example: octokit.rest.repos.createAutolink({ owner, repo, key_prefix, url_template })
4+
route: POST /repos/{owner}/{repo}/autolinks
5+
scope: repos
6+
type: API method
7+
---
8+
9+
# Create an autolink reference for a repository
10+
11+
Users with admin access to the repository can create an autolink.
12+
13+
```js
14+
octokit.rest.repos.createAutolink({
15+
owner,
16+
repo,
17+
key_prefix,
18+
url_template,
19+
});
20+
```
21+
22+
## Parameters
23+
24+
<table>
25+
<thead>
26+
<tr>
27+
<th>name</th>
28+
<th>required</th>
29+
<th>description</th>
30+
</tr>
31+
</thead>
32+
<tbody>
33+
<tr><td>owner</td><td>yes</td><td>
34+
35+
</td></tr>
36+
<tr><td>repo</td><td>yes</td><td>
37+
38+
</td></tr>
39+
<tr><td>key_prefix</td><td>yes</td><td>
40+
41+
The prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
42+
43+
</td></tr>
44+
<tr><td>url_template</td><td>yes</td><td>
45+
46+
The URL must contain <num> for the reference number.
47+
48+
</td></tr>
49+
</tbody>
50+
</table>
51+
52+
See also: [GitHub Developer Guide documentation](https://docs.github.com/v3/repos#create-an-autolink).

docs/repos/deleteAutolink.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Delete an autolink reference from a repository
3+
example: octokit.rest.repos.deleteAutolink({ owner, repo, autolink_id })
4+
route: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}
5+
scope: repos
6+
type: API method
7+
---
8+
9+
# Delete an autolink reference from a repository
10+
11+
This deletes a single autolink reference by ID that was configured for the given repository.
12+
13+
Information about autolinks are only available to repository administrators.
14+
15+
```js
16+
octokit.rest.repos.deleteAutolink({
17+
owner,
18+
repo,
19+
autolink_id,
20+
});
21+
```
22+
23+
## Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th>name</th>
29+
<th>required</th>
30+
<th>description</th>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
<tr><td>owner</td><td>yes</td><td>
35+
36+
</td></tr>
37+
<tr><td>repo</td><td>yes</td><td>
38+
39+
</td></tr>
40+
<tr><td>autolink_id</td><td>yes</td><td>
41+
42+
autolink_id parameter
43+
44+
</td></tr>
45+
</tbody>
46+
</table>
47+
48+
See also: [GitHub Developer Guide documentation](https://docs.github.com/v3/repos#delete-autolink).

docs/repos/getAutolink.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Get an autolink reference of a repository
3+
example: octokit.rest.repos.getAutolink({ owner, repo, autolink_id })
4+
route: GET /repos/{owner}/{repo}/autolinks/{autolink_id}
5+
scope: repos
6+
type: API method
7+
---
8+
9+
# Get an autolink reference of a repository
10+
11+
This returns a single autolink reference by ID that was configured for the given repository.
12+
13+
Information about autolinks are only available to repository administrators.
14+
15+
```js
16+
octokit.rest.repos.getAutolink({
17+
owner,
18+
repo,
19+
autolink_id,
20+
});
21+
```
22+
23+
## Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th>name</th>
29+
<th>required</th>
30+
<th>description</th>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
<tr><td>owner</td><td>yes</td><td>
35+
36+
</td></tr>
37+
<tr><td>repo</td><td>yes</td><td>
38+
39+
</td></tr>
40+
<tr><td>autolink_id</td><td>yes</td><td>
41+
42+
autolink_id parameter
43+
44+
</td></tr>
45+
</tbody>
46+
</table>
47+
48+
See also: [GitHub Developer Guide documentation](https://docs.github.com/v3/repos#get-autolink).

docs/repos/listAutolinks.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: List all autolinks of a repository
3+
example: octokit.rest.repos.listAutolinks({ owner, repo })
4+
route: GET /repos/{owner}/{repo}/autolinks
5+
scope: repos
6+
type: API method
7+
---
8+
9+
# List all autolinks of a repository
10+
11+
This returns a list of autolinks configured for the given repository.
12+
13+
Information about autolinks are only available to repository administrators.
14+
15+
```js
16+
octokit.rest.repos.listAutolinks({
17+
owner,
18+
repo,
19+
});
20+
```
21+
22+
## Parameters
23+
24+
<table>
25+
<thead>
26+
<tr>
27+
<th>name</th>
28+
<th>required</th>
29+
<th>description</th>
30+
</tr>
31+
</thead>
32+
<tbody>
33+
<tr><td>owner</td><td>yes</td><td>
34+
35+
</td></tr>
36+
<tr><td>repo</td><td>yes</td><td>
37+
38+
</td></tr>
39+
<tr><td>page</td><td>no</td><td>
40+
41+
Page number of the results to fetch.
42+
43+
</td></tr>
44+
</tbody>
45+
</table>
46+
47+
See also: [GitHub Developer Guide documentation](https://docs.github.com/v3/repos#list-autolinks).

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.22.0",
27+
"@octokit/types": "^6.23.0",
2828
"deprecation": "^2.3.1"
2929
},
3030
"devDependencies": {

0 commit comments

Comments
 (0)