mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-10 18:44:19 +00:00
Use @adobe/node-fetch-retry instead of node-fetch. Fix #187
This commit is contained in:
parent
fe9a9bd329
commit
3f7b9fcbad
3 changed files with 36 additions and 4 deletions
31
package-lock.json
generated
31
package-lock.json
generated
|
@ -28,6 +28,15 @@
|
|||
"tunnel": "0.0.6"
|
||||
}
|
||||
},
|
||||
"@adobe/node-fetch-retry": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/@adobe/node-fetch-retry/download/@adobe/node-fetch-retry-2.0.0.tgz",
|
||||
"integrity": "sha512-yqyY8yfHtVRMhy9JHiu9gVhnHVZfZRRTEWWinBGnSCLijLggslWdXsflOf80odzjRueQOzJl3/wbfzFeXpsNwA==",
|
||||
"requires": {
|
||||
"abort-controller": "^3.0.0",
|
||||
"node-fetch": "^2.6.1"
|
||||
}
|
||||
},
|
||||
"@babel/code-frame": {
|
||||
"version": "7.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
|
||||
|
@ -536,6 +545,15 @@
|
|||
"@octokit/openapi-types": "^9.2.0"
|
||||
}
|
||||
},
|
||||
"@types/adobe__node-fetch-retry": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/@types/adobe__node-fetch-retry/download/@types/adobe__node-fetch-retry-1.0.3.tgz",
|
||||
"integrity": "sha512-uAK2VB1zaK71u+Vgaok81Fy4tFugr2Sl7EhECvRBnSn+TNWGY2f15Q8/arKTw+wJFVTb9QciDz0hwDS+lCwyYg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node-fetch": "^2.5.12"
|
||||
}
|
||||
},
|
||||
"@types/babel__core": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.3.tgz",
|
||||
|
@ -702,6 +720,14 @@
|
|||
"integrity": "sha512-1zSbbCuoIjafKZ3mblY5ikvAb0ODUbqBnFuUb7f6uLeQhhGJ0vEV4ntmtxKLT2WgXCO94E07BjunsIw1jOMPZw==",
|
||||
"dev": true
|
||||
},
|
||||
"abort-controller": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/abort-controller/download/abort-controller-3.0.0.tgz",
|
||||
"integrity": "sha1-6vVNU7YrrkE46AnKIlyEOabvs5I=",
|
||||
"requires": {
|
||||
"event-target-shim": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"acorn": {
|
||||
"version": "5.7.3",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz",
|
||||
|
@ -1533,6 +1559,11 @@
|
|||
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
|
||||
"dev": true
|
||||
},
|
||||
"event-target-shim": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/event-target-shim/download/event-target-shim-5.0.1.tgz",
|
||||
"integrity": "sha1-XU0+vflYPWOlMzzi3rdICrKwV4k="
|
||||
},
|
||||
"exec-sh": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.2.tgz",
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
"dependencies": {
|
||||
"@actions/core": "^1.4.0",
|
||||
"@actions/github": "^5.0.0",
|
||||
"@adobe/node-fetch-retry": "^2.0.0",
|
||||
"@octokit/plugin-retry": "^3.0.9",
|
||||
"@octokit/plugin-throttling": "^3.5.1",
|
||||
"glob": "^7.1.6",
|
||||
"mime": "^2.4.4",
|
||||
"node-fetch": "^2.6.1"
|
||||
"mime": "^2.4.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/adobe__node-fetch-retry": "^1.0.3",
|
||||
"@types/glob": "^7.1.1",
|
||||
"@types/jest": "^24.0.25",
|
||||
"@types/mime": "^2.0.1",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import fetch from "node-fetch";
|
||||
import fetch from "@adobe/node-fetch-retry";
|
||||
import { GitHub } from "@actions/github/lib/utils";
|
||||
import { Config, isTag, releaseBody } from "./util";
|
||||
import { statSync, readFileSync } from "fs";
|
||||
|
@ -159,7 +159,7 @@ export const upload = async (
|
|||
console.log(`⬆️ Uploading ${name}...`);
|
||||
const endpoint = new URL(url);
|
||||
endpoint.searchParams.append("name", name);
|
||||
const resp = await fetch(endpoint, {
|
||||
const resp = await fetch(endpoint.toString(), {
|
||||
headers: {
|
||||
"content-length": `${size}`,
|
||||
"content-type": mime,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue