Skip to content

Commit d8ba20f

Browse files
authored
fix(typescript): access_token is required in octokit.apps.{deleteToken,scopeToken}(). Parameter type fixes for octokit.checks.create() (#356)
1 parent e0988c8 commit d8ba20f

File tree

6 files changed

+30
-560
lines changed

6 files changed

+30
-560
lines changed

docs/apps/deleteToken.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Delete an app token
3-
example: octokit.apps.deleteToken({ client_id })
3+
example: octokit.apps.deleteToken({ client_id, access_token })
44
route: DELETE /applications/{client_id}/token
55
scope: apps
66
type: API method
@@ -13,6 +13,7 @@ OAuth application owners can revoke a single token for an OAuth application. You
1313
```js
1414
octokit.apps.deleteToken({
1515
client_id,
16+
access_token,
1617
});
1718
```
1819

@@ -32,7 +33,7 @@ octokit.apps.deleteToken({
3233
The client ID of your GitHub app.
3334

3435
</td></tr>
35-
<tr><td>access_token</td><td>no</td><td>
36+
<tr><td>access_token</td><td>yes</td><td>
3637

3738
The OAuth access token used to authenticate to the GitHub API.
3839

docs/apps/scopeToken.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Create a scoped access token
3-
example: octokit.apps.scopeToken({ client_id })
3+
example: octokit.apps.scopeToken({ client_id, access_token })
44
route: POST /applications/{client_id}/token/scoped
55
scope: apps
66
type: API method
@@ -13,6 +13,7 @@ Exchanges a non-repository scoped user-to-server OAuth access token for a reposi
1313
```js
1414
octokit.apps.scopeToken({
1515
client_id,
16+
access_token,
1617
});
1718
```
1819

@@ -32,7 +33,7 @@ octokit.apps.scopeToken({
3233
The client ID of your GitHub app.
3334

3435
</td></tr>
35-
<tr><td>access_token</td><td>no</td><td>
36+
<tr><td>access_token</td><td>yes</td><td>
3637

3738
**Required.** The OAuth access token used to authenticate to the GitHub API.
3839

docs/checks/create.md

Lines changed: 5 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Create a check run
3-
example: octokit.checks.create({ owner, repo, name, head_sha, output.title, output.summary, output.annotations[].path, output.annotations[].start_line, output.annotations[].end_line, output.annotations[].annotation_level, output.annotations[].message, output.images[].alt, output.images[].image_url, actions[].label, actions[].description, actions[].identifier })
3+
example: octokit.checks.create({ owner, repo })
44
route: POST /repos/{owner}/{repo}/check-runs
55
scope: checks
66
type: API method
@@ -16,23 +16,9 @@ In a check suite, GitHub limits the number of check runs with the same name to 1
1616

1717
```js
1818
octokit.checks.create({
19-
owner,
20-
repo,
21-
name,
22-
head_sha,
23-
output.title,
24-
output.summary,
25-
output.annotations[].path,
26-
output.annotations[].start_line,
27-
output.annotations[].end_line,
28-
output.annotations[].annotation_level,
29-
output.annotations[].message,
30-
output.images[].alt,
31-
output.images[].image_url,
32-
actions[].label,
33-
actions[].description,
34-
actions[].identifier
35-
})
19+
owner,
20+
repo,
21+
});
3622
```
3723

3824
## Parameters
@@ -51,156 +37,11 @@ actions[].identifier
5137
</td></tr>
5238
<tr><td>repo</td><td>yes</td><td>
5339

54-
</td></tr>
55-
<tr><td>name</td><td>yes</td><td>
56-
57-
The name of the check. For example, "code-coverage".
58-
59-
</td></tr>
60-
<tr><td>head_sha</td><td>yes</td><td>
61-
62-
The SHA of the commit.
63-
64-
</td></tr>
65-
<tr><td>details_url</td><td>no</td><td>
66-
67-
The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used.
68-
69-
</td></tr>
70-
<tr><td>external_id</td><td>no</td><td>
71-
72-
A reference for the run on the integrator's system.
73-
7440
</td></tr>
7541
<tr><td>status</td><td>no</td><td>
7642

77-
The current status. Can be one of `queued`, `in_progress`, or `completed`.
78-
79-
</td></tr>
80-
<tr><td>started_at</td><td>no</td><td>
81-
82-
The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
83-
84-
</td></tr>
85-
<tr><td>conclusion</td><td>no</td><td>
86-
87-
**Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. Can be one of `action_required`, `cancelled`, `failure`, `neutral`, `success`, `skipped`, `stale`, or `timed_out`. When the conclusion is `action_required`, additional details should be provided on the site specified by `details_url`.
88-
**Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this.
89-
90-
</td></tr>
91-
<tr><td>completed_at</td><td>no</td><td>
92-
93-
The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
94-
95-
</td></tr>
96-
<tr><td>output</td><td>no</td><td>
97-
98-
Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run. See the [`output` object](https://docs.github.com/rest/reference/checks#output-object) description.
99-
100-
</td></tr>
101-
<tr><td>output.title</td><td>yes</td><td>
102-
103-
The title of the check run.
104-
105-
</td></tr>
106-
<tr><td>output.summary</td><td>yes</td><td>
107-
108-
The summary of the check run. This parameter supports Markdown.
109-
110-
</td></tr>
111-
<tr><td>output.text</td><td>no</td><td>
112-
113-
The details of the check run. This parameter supports Markdown.
114-
115-
</td></tr>
116-
<tr><td>output.annotations</td><td>no</td><td>
117-
118-
Adds information from your analysis to specific lines of code. Annotations are visible on GitHub in the **Checks** and **Files changed** tab of the pull request. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about how you can view annotations on GitHub, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [`annotations` object](https://docs.github.com/rest/reference/checks#annotations-object) description for details about how to use this parameter.
119-
120-
</td></tr>
121-
<tr><td>output.annotations[].path</td><td>yes</td><td>
122-
123-
The path of the file to add an annotation to. For example, `assets/css/main.css`.
124-
125-
</td></tr>
126-
<tr><td>output.annotations[].start_line</td><td>yes</td><td>
127-
128-
The start line of the annotation.
129-
13043
</td></tr>
131-
<tr><td>output.annotations[].end_line</td><td>yes</td><td>
132-
133-
The end line of the annotation.
134-
135-
</td></tr>
136-
<tr><td>output.annotations[].start_column</td><td>no</td><td>
137-
138-
The start column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values.
139-
140-
</td></tr>
141-
<tr><td>output.annotations[].end_column</td><td>no</td><td>
142-
143-
The end column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values.
144-
145-
</td></tr>
146-
<tr><td>output.annotations[].annotation_level</td><td>yes</td><td>
147-
148-
The level of the annotation. Can be one of `notice`, `warning`, or `failure`.
149-
150-
</td></tr>
151-
<tr><td>output.annotations[].message</td><td>yes</td><td>
152-
153-
A short description of the feedback for these lines of code. The maximum size is 64 KB.
154-
155-
</td></tr>
156-
<tr><td>output.annotations[].title</td><td>no</td><td>
157-
158-
The title that represents the annotation. The maximum size is 255 characters.
159-
160-
</td></tr>
161-
<tr><td>output.annotations[].raw_details</td><td>no</td><td>
162-
163-
Details about this annotation. The maximum size is 64 KB.
164-
165-
</td></tr>
166-
<tr><td>output.images</td><td>no</td><td>
167-
168-
Adds images to the output displayed in the GitHub pull request UI. See the [`images` object](https://docs.github.com/rest/reference/checks#images-object) description for details.
169-
170-
</td></tr>
171-
<tr><td>output.images[].alt</td><td>yes</td><td>
172-
173-
The alternative text for the image.
174-
175-
</td></tr>
176-
<tr><td>output.images[].image_url</td><td>yes</td><td>
177-
178-
The full URL of the image.
179-
180-
</td></tr>
181-
<tr><td>output.images[].caption</td><td>no</td><td>
182-
183-
A short image description.
184-
185-
</td></tr>
186-
<tr><td>actions</td><td>no</td><td>
187-
188-
Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the [`check_run.requested_action` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) to your app. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. See the [`actions` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)."
189-
190-
</td></tr>
191-
<tr><td>actions[].label</td><td>yes</td><td>
192-
193-
The text to be displayed on a button in the web UI. The maximum size is 20 characters.
194-
195-
</td></tr>
196-
<tr><td>actions[].description</td><td>yes</td><td>
197-
198-
A short explanation of what this action would do. The maximum size is 40 characters.
199-
200-
</td></tr>
201-
<tr><td>actions[].identifier</td><td>yes</td><td>
202-
203-
A reference for the action on the integrator's system. The maximum size is 20 characters.
44+
<tr><td>*</td><td>no</td><td>
20445

20546
</td></tr>
20647
</tbody>

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

0 commit comments

Comments
 (0)