Skip to content

Commit 2eba2a8

Browse files
authored
fix(typescript): .rest.repos.uploadReleaseAsset() requires name parameter. .head.repo property is optional in pull request response type (#423)
1 parent 7f8da6b commit 2eba2a8

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

.github/workflows/update.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ jobs:
2626

2727
# try checking out routes-update branch. Ignore error if it does not exist
2828
- run: git checkout routes-update || true
29+
30+
# if event is coming from octokit/types.ts, update @octokit/types to latest version and get OpenAPI version from its package.json
31+
# Do the npm install before `npm ci` to avoid ENOTEMPTY error, see:
32+
# https://github.com/actions/setup-node/issues/303#issuecomment-885723049
33+
- run: npm install @octokit/types@latest
34+
if: github.event_name == 'repository_dispatch' && github.event.action == 'octokit/types.ts release'
35+
2936
- run: npm ci
3037
- run: rm -rf docs/
3138

@@ -41,9 +48,6 @@ jobs:
4148
env:
4249
VERSION: ${{ github.event.inputs.version }}
4350

44-
# if event is coming from octokit/types.ts, update @octokit/types to latest version and get OpenAPI version from its package.json
45-
- run: npm install @octokit/types@latest
46-
if: github.event_name == 'repository_dispatch' && github.event.action == 'octokit/types.ts release'
4751
- run: node -e "console.log('::set-output name=version::' + require('@octokit/types/package').octokit['openapi-version'])"
4852
if: github.event_name == 'repository_dispatch' && github.event.action == 'octokit/types.ts release'
4953
id: openapi_types

docs/repos/uploadReleaseAsset.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Upload a release asset
3-
example: octokit.rest.repos.uploadReleaseAsset({ owner, repo, release_id, data })
3+
example: octokit.rest.repos.uploadReleaseAsset({ owner, repo, release_id, name, data })
44
route: POST {origin}/repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}
55
scope: repos
66
type: API method
@@ -33,6 +33,7 @@ octokit.rest.repos.uploadReleaseAsset({
3333
owner,
3434
repo,
3535
release_id,
36+
name,
3637
data,
3738
});
3839
```
@@ -59,7 +60,7 @@ octokit.rest.repos.uploadReleaseAsset({
5960
release_id parameter
6061

6162
</td></tr>
62-
<tr><td>name</td><td>no</td><td>
63+
<tr><td>name</td><td>yes</td><td>
6364

6465
</td></tr>
6566
<tr><td>label</td><td>no</td><td>

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

scripts/update-endpoints/generated/endpoints.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47226,7 +47226,7 @@
4722647226
"description": "",
4722747227
"in": "QUERY",
4722847228
"type": "string",
47229-
"required": false,
47229+
"required": true,
4723047230
"enum": null,
4723147231
"allowNull": false,
4723247232
"mapToData": null,

0 commit comments

Comments
 (0)