Skip to content

Commit

Permalink
Fix bug with uploading github asset
Browse files Browse the repository at this point in the history
wrong repo info were hardcoded
  • Loading branch information
kabaros committed Jun 18, 2020
1 parent e4b8d68 commit 55497f6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
23 changes: 23 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"execa": "^4.0.0",
"follow-redirects": "^1.11.0",
"github-url-from-git": "^1.5.0",
"hosted-git-info": "^3.0.4",
"inquirer": "^7.1.0",
"minimist": "^1.2.5",
"new-github-release-url": "^1.0.0",
Expand Down
16 changes: 11 additions & 5 deletions src/release/uploadRelease.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ const chalk = require('chalk')
const { createReadStream, statSync } = require('fs')
const { basename } = require('path')
const process = require('process')
const hostedGitInfo = require('hosted-git-info')
const { log, error, info, success, warn, debug } = require('../utils/log')
const { getRemoteUrl } = require('../utils/git')

let octokit

module.exports = async ({ tag, pluginName, tarFile }) => {
const owner = 'kabaros'
const repo = 'hypothesis'
const remoteUrl = await getRemoteUrl()
debug(`remote url for current folder: ${remoteUrl}`)

const { user: owner, project: repo } = hostedGitInfo.fromUrl(remoteUrl)
debug(`current repo info. Owner: ${owner}, Repo: ${repo}`)

let url

Expand Down Expand Up @@ -104,9 +109,10 @@ async function getReleaseUrl(token, { owner, repo, tag }) {
auth: `token ${token}`
})

debug(`Getting release upload url. Owner: ${owner}. \n
\trepo ${repo}. \n
\ttag ${tag}`)
debug(`Getting release upload url.
\tOwner: ${owner}.
\trepo: ${repo}.
\ttag: ${tag}`)

const release = await octokit.repos.getReleaseByTag({ owner, repo, tag })

Expand Down

0 comments on commit 55497f6

Please sign in to comment.