Skip to content

Close stale PRs with GitHub actions #7999

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

Closed
wants to merge 1 commit into from

Conversation

iluuu1994
Copy link
Member

As discussed in r11. Open question:

operations-per-run is currently configured to 30.

This option aims to limit the number of operations made with the GitHub API to avoid reaching the rate limit.

I'm not sure if we're subject to rate limiting. Leaving it as is would probably mean that stale PRs would only get closed over time instead of at once.

debug-only is enabled since I'm not sure if GitHub will run actions that are not merged yet. We might even leave it enabled after merging for a few days to see if it behaves correctly.

@cmb69
Copy link
Member

cmb69 commented Jan 25, 2022

Thank you! I'm generally fine with automatically closing inactive PRs, and the implementation seems to be okay. Maybe we should also echo the closed-issues-prs (an output param of actions/stale), or enable logging – or is there already a way to see which PRs would be affected?

I'm not sure if we're subject to rate limiting. Leaving it as is would probably mean that stale PRs would only get closed over time instead of at once.

I don't think this is a big problem. At least after a while, it's unlikely that we'll have more than 30 PRs to close per day.

We might even leave it enabled after merging for a few days to see if it behaves correctly.

Yeah, that looks reasonable.

@iluuu1994
Copy link
Member Author

or is there already a way to see which PRs would be affected?

Yes, actions/stale already does pretty extensive logging. See my test repo:

https://github.com/iluuu1994/stale-prs/runs/4941250141?check_suite_focus=true

@iluuu1994
Copy link
Member Author

I don't think this is a big problem. At least after a while, it's unlikely that we'll have more than 30 PRs to close per day.

I think this includes GET request, which makes me wonder if it will stop after a certain amount of pull requests (even if no action was performed). I guess that's something we can test only once it is merged. If that's the case we'll need to create an access token.

@iluuu1994
Copy link
Member Author

I've adjust the configuration according to the feedback. Let me know if you're ok with this now.

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me

@iluuu1994 iluuu1994 closed this in 70f712c Jan 30, 2022
@iluuu1994
Copy link
Member Author

Thanks! I'll check the output of the action in the coming days and disable debug-only if everything is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants