Skip to content

Commit

Permalink
fix(auth): use asset url instead of browser download
Browse files Browse the repository at this point in the history
  • Loading branch information
marmorag committed Jan 24, 2022
1 parent 1cb1bef commit efeacde
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ function run() {
const found = getReleaseUrl.data.assets.map(f => f.name);
throw new Error(`Could not find a release for ${tag}. Found: ${found}`);
}
const url = asset.browser_download_url;
const url = asset.url;
const authString = `bearer ${token}`;
core.info(`Downloading ${project} from ${url}`);
const binPath = yield tc.downloadTool(url, '', authString);
const binPath = yield tc.downloadTool(url, '', authString, {
accept: "application/octet-stream"
});
let extractedPath = yield tc.extractTar(binPath);
core.info(`Successfully extracted ${project} to ${extractedPath}`);
core.addPath(extractedPath);
Expand Down
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ async function run() {
)
}

const url = asset.browser_download_url
const url = asset.url
const authString = `bearer ${token}`

core.info(`Downloading ${project} from ${url}`)
const binPath = await tc.downloadTool(url, '', authString);
const binPath = await tc.downloadTool(url, '', authString, {
accept: "application/octet-stream"
});
let extractedPath = await tc.extractTar(binPath);
core.info(`Successfully extracted ${project} to ${extractedPath}`)

Expand Down

0 comments on commit efeacde

Please sign in to comment.