Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(auth): missing auth string in download release #11

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 8 additions & 9 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand All @@ -18,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Expand Down Expand Up @@ -59,7 +55,7 @@ function run() {
core.info(`Retrying after ${retryAfter} seconds.`);
return true;
},
} }, (0, utils_1.getOctokitOptions)(token)));
} }, utils_1.getOctokitOptions(token)));
const repo = core.getInput("repo");
if (!repo) {
throw new Error(`Repo was not specified`);
Expand Down Expand Up @@ -156,9 +152,12 @@ function run() {
throw new Error(`Could not find a release for ${tag}. Found: ${found}`);
}
const extractFn = getExtractFn(asset.name);
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);
const binPath = yield tc.downloadTool(url, '', authString, {
accept: "application/octet-stream"
});
yield extractFn(binPath, dest);
if (cacheEnabled && cacheKey !== undefined) {
try {
Expand Down
7 changes: 5 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,13 @@ async function run() {

const extractFn = getExtractFn(asset.name);

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);
const binPath = await tc.downloadTool(url, '', authString, {
accept: "application/octet-stream"
});
await extractFn(binPath, dest);

if (cacheEnabled && cacheKey !== undefined) {
Expand Down