Skip to content

Commit

Permalink
feat: .rest.repos.createAutolink(), .rest.repos.listAutolinks(), …
Browse files Browse the repository at this point in the history
…`.rest.repos.getAutolink()`, `.rest.repos.deleteAutolink()` (#427)
  • Loading branch information
octokitbot authored Aug 2, 2021
1 parent 5fb8342 commit dd176ff
Show file tree
Hide file tree
Showing 10 changed files with 561 additions and 8 deletions.
52 changes: 52 additions & 0 deletions docs/repos/createAutolink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Create an autolink reference for a repository
example: octokit.rest.repos.createAutolink({ owner, repo, key_prefix, url_template })
route: POST /repos/{owner}/{repo}/autolinks
scope: repos
type: API method
---

# Create an autolink reference for a repository

Users with admin access to the repository can create an autolink.

```js
octokit.rest.repos.createAutolink({
owner,
repo,
key_prefix,
url_template,
});
```

## 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>
<tr><td>key_prefix</td><td>yes</td><td>

The prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.

</td></tr>
<tr><td>url_template</td><td>yes</td><td>

The URL must contain <num> for the reference number.

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

See also: [GitHub Developer Guide documentation](https://docs.github.com/v3/repos#create-an-autolink).
48 changes: 48 additions & 0 deletions docs/repos/deleteAutolink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Delete an autolink reference from a repository
example: octokit.rest.repos.deleteAutolink({ owner, repo, autolink_id })
route: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}
scope: repos
type: API method
---

# Delete an autolink reference from a repository

This deletes a single autolink reference by ID that was configured for the given repository.

Information about autolinks are only available to repository administrators.

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

## 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>
<tr><td>autolink_id</td><td>yes</td><td>

autolink_id parameter

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

See also: [GitHub Developer Guide documentation](https://docs.github.com/v3/repos#delete-autolink).
48 changes: 48 additions & 0 deletions docs/repos/getAutolink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Get an autolink reference of a repository
example: octokit.rest.repos.getAutolink({ owner, repo, autolink_id })
route: GET /repos/{owner}/{repo}/autolinks/{autolink_id}
scope: repos
type: API method
---

# Get an autolink reference of a repository

This returns a single autolink reference by ID that was configured for the given repository.

Information about autolinks are only available to repository administrators.

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

## 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>
<tr><td>autolink_id</td><td>yes</td><td>

autolink_id parameter

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

See also: [GitHub Developer Guide documentation](https://docs.github.com/v3/repos#get-autolink).
47 changes: 47 additions & 0 deletions docs/repos/listAutolinks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: List all autolinks of a repository
example: octokit.rest.repos.listAutolinks({ owner, repo })
route: GET /repos/{owner}/{repo}/autolinks
scope: repos
type: API method
---

# List all autolinks of a repository

This returns a list of autolinks configured for the given repository.

Information about autolinks are only available to repository administrators.

```js
octokit.rest.repos.listAutolinks({
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>
<tr><td>page</td><td>no</td><td>

Page number of the results to fetch.

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

See also: [GitHub Developer Guide documentation](https://docs.github.com/v3/repos#list-autolinks).
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.22.0",
"@octokit/types": "^6.23.0",
"deprecation": "^2.3.1"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit dd176ff

Please sign in to comment.