fix: Update to latest throttling plugin (#53)
In attempt to fix unintentional retries on 422 error from GitHub, 1. Update to latest `@octokit/plugin-throttling` version 2. Depend on `@octokit/plugin-retry` plugin as well Issue: #52
This commit is contained in:
parent
9a89d1e63f
commit
9439581056
40
package-lock.json
generated
40
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "action-gh-release",
|
"name": "action-gh-release",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -434,12 +434,42 @@
|
|||||||
"universal-user-agent": "^4.0.0"
|
"universal-user-agent": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@octokit/plugin-throttling": {
|
"@octokit/plugin-retry": {
|
||||||
"version": "2.7.1",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-2.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.2.tgz",
|
||||||
"integrity": "sha512-08CKNFCpSpmOEAQBn6/MR8zbJgjP4+bplNUJbKlqJSNBHTO1NdsDHzBD4VeFYopOo7rBEySng4WifxNVaQ5bVw==",
|
"integrity": "sha512-k7xl2WLfLP7WirRXRHtCq5xGAIXBZHV9X3HVUJhPwe8/N8vVzxPcnnnBL5NpEep/+GQqFRdYxrkgz68VY3z2wA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"@octokit/types": "^4.0.1",
|
||||||
"bottleneck": "^2.15.3"
|
"bottleneck": "^2.15.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/types": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-Ho6h7w2h9y8RRE8r656hIj1oiSbwbIHJGF5r9G5FOwS2VdDPq8QLGvsG4x6pKHpvyGK7j+43sAc2cJKMiFoIJw==",
|
||||||
|
"requires": {
|
||||||
|
"@types/node": ">= 8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@octokit/plugin-throttling": {
|
||||||
|
"version": "3.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-3.2.1.tgz",
|
||||||
|
"integrity": "sha512-CGr3IagYZLLV3pFgpTQUthQSS5K3BkHLlG8yXK+Op3UKBkYrTf+Y9pCebrDxt60d+VTQ1oxXCx+LVLYY3IhBZQ==",
|
||||||
|
"requires": {
|
||||||
|
"@octokit/types": "^4.0.1",
|
||||||
|
"bottleneck": "^2.15.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/types": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-Ho6h7w2h9y8RRE8r656hIj1oiSbwbIHJGF5r9G5FOwS2VdDPq8QLGvsG4x6pKHpvyGK7j+43sAc2cJKMiFoIJw==",
|
||||||
|
"requires": {
|
||||||
|
"@types/node": ">= 8"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@octokit/request": {
|
"@octokit/request": {
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.0",
|
"@actions/core": "^1.2.0",
|
||||||
"@actions/github": "^2.0.0",
|
"@actions/github": "^2.0.0",
|
||||||
"@octokit/plugin-throttling": "^2.7.1",
|
"@octokit/plugin-retry": "^3.0.2",
|
||||||
|
"@octokit/plugin-throttling": "^3.2.1",
|
||||||
"glob": "^7.1.6",
|
"glob": "^7.1.6",
|
||||||
"mime": "^2.4.4"
|
"mime": "^2.4.4"
|
||||||
},
|
},
|
||||||
|
@ -10,8 +10,12 @@ async function run() {
|
|||||||
if (!config.input_tag_name && !isTag(config.github_ref)) {
|
if (!config.input_tag_name && !isTag(config.github_ref)) {
|
||||||
throw new Error(`⚠️ GitHub Releases requires a tag`);
|
throw new Error(`⚠️ GitHub Releases requires a tag`);
|
||||||
}
|
}
|
||||||
GitHub.plugin(require("@octokit/plugin-throttling"));
|
GitHub.plugin([
|
||||||
|
require("@octokit/plugin-throttling"),
|
||||||
|
require("@octokit/plugin-retry")
|
||||||
|
]);
|
||||||
const gh = new GitHub(config.github_token, {
|
const gh = new GitHub(config.github_token, {
|
||||||
|
throttle: {
|
||||||
onRateLimit: (retryAfter, options) => {
|
onRateLimit: (retryAfter, options) => {
|
||||||
console.warn(
|
console.warn(
|
||||||
`Request quota exhausted for request ${options.method} ${options.url}`
|
`Request quota exhausted for request ${options.method} ${options.url}`
|
||||||
@ -28,6 +32,7 @@ async function run() {
|
|||||||
`Abuse detected for request ${options.method} ${options.url}`
|
`Abuse detected for request ${options.method} ${options.url}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let rel = await release(config, new GitHubReleaser(gh));
|
let rel = await release(config, new GitHubReleaser(gh));
|
||||||
if (config.input_files) {
|
if (config.input_files) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user