-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI(Preview): add retries to find PR script #20
Conversation
Welcome to new-connect! Make sure to:
deployed preview: https://20.connect-d5y.pages.dev |
Meant to run this PR on my fork to see if it fixed the secondary rate limit problem I was hitting with my other PRs. My bad |
.github/workflows/preview.yaml
Outdated
const pullRequestNumber = items[0].number | ||
console.info("Pull request number is", pullRequestNumber) | ||
return pullRequestNumber | ||
return findPR(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to wrap this in a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe wrapping it in a function is not needed here, but the intention was to make it easier to manage, to debug, and easier to simulate different scenarios to make sure the retry logic works as expected. But maybe it’s overkill? Let me know if you prefer it a certain way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to just set retries
on the action, it will handle the Retry-After
header for us
https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api#handle-rate-limit-errors-appropriately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. Thanks for the fix!
To my understanding this is so pose to help by increasing the rate limit since I added the Github Token. I also added a retry mechanism instead of trying to rerun actions manually. I noticed that Cameron also ran into the secondary rate limit so hopefully this would help us not hit that limit anymore.
I'm not entirely confident this would help so feel free to close this. My previous PRs are now able to generate the Preview Link.
Reference Link: docs.github.com