mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-06-28 06:16:01 +00:00
retry when error
This commit is contained in:
parent
806116bda4
commit
380a3b30ea
5 changed files with 12239 additions and 19 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
5839
node_modules/.package-lock.json
generated
vendored
5839
node_modules/.package-lock.json
generated
vendored
File diff suppressed because it is too large
Load diff
6408
package-lock.json
generated
6408
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -32,7 +32,7 @@
|
||||||
"@types/jest": "^24.0.25",
|
"@types/jest": "^24.0.25",
|
||||||
"@types/mime": "^2.0.1",
|
"@types/mime": "^2.0.1",
|
||||||
"@types/node": "^12.12.24",
|
"@types/node": "^12.12.24",
|
||||||
"@zeit/ncc": "^0.21.0",
|
"@zeit/ncc": "^0.21.1",
|
||||||
"jest": "^24.9.0",
|
"jest": "^24.9.0",
|
||||||
"jest-circus": "^24.9.0",
|
"jest-circus": "^24.9.0",
|
||||||
"prettier": "1.19.1",
|
"prettier": "1.19.1",
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { Config, releaseBody } from "./util";
|
||||||
import { lstatSync, readFileSync } from "fs";
|
import { lstatSync, readFileSync } from "fs";
|
||||||
import { getType } from "mime";
|
import { getType } from "mime";
|
||||||
import { basename } from "path";
|
import { basename } from "path";
|
||||||
|
import { time } from "console";
|
||||||
|
|
||||||
export interface ReleaseAsset {
|
export interface ReleaseAsset {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -145,7 +146,7 @@ export const upload = async (
|
||||||
export const release = async (
|
export const release = async (
|
||||||
config: Config,
|
config: Config,
|
||||||
releaser: Releaser,
|
releaser: Releaser,
|
||||||
maxRetries: number = 3
|
maxRetries: number = 10
|
||||||
): Promise<Release> => {
|
): Promise<Release> => {
|
||||||
if (maxRetries <= 0) {
|
if (maxRetries <= 0) {
|
||||||
console.log(`❌ Too many retries. Aborting...`);
|
console.log(`❌ Too many retries. Aborting...`);
|
||||||
|
@ -259,7 +260,9 @@ export const release = async (
|
||||||
console.log(
|
console.log(
|
||||||
`⚠️ Unexpected error fetching GitHub release for tag ${config.github_ref}: ${error}`
|
`⚠️ Unexpected error fetching GitHub release for tag ${config.github_ref}: ${error}`
|
||||||
);
|
);
|
||||||
throw error;
|
// throw error;
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||||
|
return release(config, releaser, maxRetries - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue