Hitting abuse rate limit in github action when deleting tags #1980
-
Hi, Delete release error: HttpError: You have triggered an abuse detection mechanism. Please wait a few minutes before you try again. The code is here: Is there a way to run this action without hitting the limits? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
It doesn't look like you are using const { Octokit } = require("@octokit/action");
const { throttling } = require("@octokit/plugin-throttling");
const MyOctokit = Octokit.plugin(throttling).defaults({
throttle: {
onRateLimit: (retryAfter, options, octokit) => {
octokit.log.warn(
`Request quota exhausted for request ${options.method} ${options.url}`
);
if (options.request.retryCount === 0) {
// only retries once
octokit.log.info(`Retrying after ${retryAfter} seconds!`);
return true;
}
},
onAbuseLimit: (retryAfter, options, octokit) => {
// does not retry, only logs a warning
octokit.log.warn(
`Abuse detected for request ${options.method} ${options.url}`
);
},
},
}) Then instead of using const octokit = new MyOctokit() |
Beta Was this translation helpful? Give feedback.
It doesn't look like you are using
@octokit/rest
, butactions-toolkit
. I do not maintain this library. I think they use Octokit internally but I don't know how up-to-date it is. If you like you can use https://github.com/octokit/action.js, in which case you could load the throttle plugin, which will help to reduce the problem of hitting rate/abuse limits.