mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-11 02:44:20 +00:00
utilize formatted upload url
This commit is contained in:
parent
3c2ce6b9bd
commit
935aebbf1d
2 changed files with 11 additions and 5 deletions
4
dist/index.js
vendored
4
dist/index.js
vendored
|
@ -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;
|
||||
});
|
||||
|
|
12
src/main.ts
12
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue