fix asset fail workaround (#16680)

* fix asset fail workaround

* uploadResponse.data.id => uploadResponse.id

* asset_id => id
This commit is contained in:
Shelley Vohr
2019-02-01 10:21:50 -08:00
committed by GitHub
parent f774303923
commit e61c8543f1

View File

@@ -30,10 +30,10 @@ function uploadToGitHub () {
github.repos.uploadAsset(githubOpts).then((uploadResponse) => {
console.log(`Successfully uploaded ${fileName} to GitHub as ${fakeFileName}. Going for the rename now.`)
return github.repos.updateAsset({
return github.repos.editAsset({
owner: 'electron',
repo: 'electron',
asset_id: uploadResponse.data.id,
id: uploadResponse.data.id,
name: fileName
}).then(() => {
console.log(`Successfully renamed ${fakeFileName} to ${fileName}. All done now.`)
@@ -53,7 +53,7 @@ function uploadToGitHub () {
existingAssets.map(existingAsset => github.repos.deleteAsset({
owner: 'electron',
repo: targetRepo,
asset_id: existingAsset.id
id: existingAsset.id
}))
).catch((deleteErr) => {
console.log(`Failed to delete existing asset ${fileName}. Error was:`, deleteErr)