github-script icon indicating copy to clipboard operation
github-script copied to clipboard

Ability to Use throttling Plugin

Open timharris777 opened this issue 2 years ago • 5 comments

I would like the ability to use the throttling plugin. I was going to create a PR but it looks like the octokit client is instantiated using the @actions/github package, which would mean I would need to make a PR for that codebase first and then create a PR for this codebase once that codebase has merged it.

So... is there a reason why this codebase is using @actions/github instead of just including the @octokit/** packages directly and instantiating directly. This would avoid having to PR to the other repo and coordinate releases in order to support octokit plugin functionality.

I'm happy to make the change in a PR and make sure everything is working if y'all are on board. Just let me know. Thanks!

timharris777 avatar Jan 10 '22 18:01 timharris777

I'd love to have throttling support too!

ErikSchierboom avatar Mar 08 '22 13:03 ErikSchierboom

Out of curiosity, what is the use case for throttling within an action? I'm sure there's a valid one, just can't think of it and would love to know!

jclem avatar Mar 08 '22 14:03 jclem

E.g. when doing bulk actions like opening a couple of dozen issues across repositories from a single action. You'd be hitting rate limits soon.

ErikSchierboom avatar Mar 08 '22 14:03 ErikSchierboom

when doing bulk actions like opening a couple of dozen issues across repositories from a single action. You'd be hitting rate limits soon.

Ah yeah that makes sense. I guess I hadn't considered use of actions/github-script in a workflow that runs long enough to recover from rate limiting and then continue, but there's no reason one can't do that!

jclem avatar Mar 08 '22 15:03 jclem

Until this is officially supported, we have achieved the same by using the wrap hook, here's a great example from @gr2m: https://github.com/octokit/octokit.js/issues/1069#throttling

markmssd avatar Apr 04 '22 13:04 markmssd