Fix for new octokit

This commit is contained in:
Sven-Hendrik Haase
2020-07-03 06:59:57 +02:00
parent d082cf3f16
commit 7cac809eef
2 changed files with 4 additions and 18 deletions

View File

@@ -51,7 +51,6 @@ async function upload_to_release(
core.debug(`Skipping ${file}, since its not a file`)
return
}
const file_size = stat.size
const file_bytes = fs.readFileSync(file)
// Check for duplicates.
@@ -81,13 +80,9 @@ async function upload_to_release(
core.debug(`Uploading ${file} to ${asset_name} in release ${tag}.`)
await octokit.repos.uploadReleaseAsset({
url: release.data.upload_url,
name: asset_name,
file: file_bytes,
headers: {
'content-type': 'binary/octet-stream',
'content-length': file_size
}
...github.context.repo,
release_id: release.data.id,
data: file_bytes
})
}