From 935aebbf1d35955b76f7fea4a6c2659a65b8a1bc Mon Sep 17 00:00:00 2001 From: softprops Date: Sat, 7 Aug 2021 23:31:49 -0400 Subject: [PATCH] utilize formatted upload url --- dist/index.js | 4 ++-- src/main.ts | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9c4eb04..ad7b416 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2139,14 +2139,14 @@ function run() { } }); //); - let rel = yield github_1.release(config, new github_1.GitHubReleaser(gh)); + const rel = yield github_1.release(config, new github_1.GitHubReleaser(gh)); if (config.input_files) { const files = util_1.paths(config.input_files); if (files.length == 0) { console.warn(`🤔 ${config.input_files} not include valid file.`); } yield Promise.all(files.map((path) => __awaiter(this, void 0, void 0, function* () { - yield github_1.upload(gh, rel.upload_url, path); + yield github_1.upload(gh, util_1.uploadUrl(rel.upload_url), path); }))).catch(error => { throw error; }); diff --git a/src/main.ts b/src/main.ts index 59129ea..57bfb82 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,10 @@ -import { paths, parseConfig, isTag, unmatchedPatterns } from "./util"; +import { + paths, + parseConfig, + isTag, + unmatchedPatterns, + uploadUrl +} from "./util"; import { release, upload, GitHubReleaser } from "./github"; import { getOctokit } from "@actions/github"; import { setFailed, setOutput } from "@actions/core"; @@ -53,7 +59,7 @@ async function run() { } }); //); - let rel = await release(config, new GitHubReleaser(gh)); + const rel = await release(config, new GitHubReleaser(gh)); if (config.input_files) { const files = paths(config.input_files); if (files.length == 0) { @@ -61,7 +67,7 @@ async function run() { } await Promise.all( files.map(async path => { - await upload(gh, rel.upload_url, path); + await upload(gh, uploadUrl(rel.upload_url), path); }) ).catch(error => { throw error;