octokat.js icon indicating copy to clipboard operation
octokat.js copied to clipboard

Release Asset upload not working

Open Akkuma opened this issue 8 years ago • 3 comments

I've tried multiple combinations based on the docs and error messages.

repo
  .releases
  .create({
    tag_name: version,
    target_commitish: 'master',
    name: version
  })
  .then(release => {
    release.upload({ name: 'chrome.zip', label: 'Chrome Extension' }, 'application/zip', fs.readFileSync('./build/chrome/chrome.zip')));
    release.upload({ name: 'chrome.zip', label: 'Chrome Extension' }).create('application/zip', fs.readFileSync('./build/chrome/chrome.zip')));
    repo.releases(id).assets.create() //Both as an obj for first param and str
})

The docs claim there are 3 args and the deprecation message claims it is an object with create. The latter doesn't work because there is no create off of upload. The doc method does not work at all as it complains about Invalid name for request. If I try it as the the first listed way in the sample I get Invalid Content-Type.

Akkuma avatar Jan 26 '17 21:01 Akkuma

As of April 2017, I am also having this exact same issue. I ended up using https://www.npmjs.com/package/ghreleases instead which works just fine.

gkovacs avatar Apr 24 '17 07:04 gkovacs

Same here.

retorquere avatar Aug 06 '17 19:08 retorquere

👍

chenrui333 avatar Jan 14 '18 20:01 chenrui333