-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
octokit/openapi-types.ts
#481Labels
Status: Up for grabsIssues that are ready to be worked on by anyoneIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documentedSomething isn't working as documented
Description
What happened?
Currently you have to fool the data input parameter into thinking that the buffer is a string:
await octokit.repos.uploadReleaseAsset({
owner,
repo,
url: release.data.upload_url,
release_id: release.data.id,
data: (fs.readFileSync(asset) as unknown as string), // fool octokit into accepting the Buffer
headers: {
'content-type': contentType,
'content-length': fs.statSync(asset).size,
},
name,
});Ideally you should be able to pass the buffer directly:
await octokit.repos.uploadReleaseAsset({
owner,
repo,
url: release.data.upload_url,
release_id: release.data.id,
data: fs.readFileSync(asset),
headers: {
'content-type': contentType,
'content-length': fs.statSync(asset).size,
},
name,
});Versions
latest
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Status: Up for grabsIssues that are ready to be worked on by anyoneIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documentedSomething isn't working as documented
Type
Projects
Status
🔥 Backlog