Skip to content
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

Add select_label option #12

Merged
merged 7 commits into from
Mar 27, 2023
Merged

Add select_label option #12

merged 7 commits into from
Mar 27, 2023

Conversation

benCoomes
Copy link
Contributor

@benCoomes benCoomes commented Mar 27, 2023

This PR adds the select_label option, which causes combine-pr to ignore any PR that does not have a label matching select_label.

This will be useful in a few ways:

  • PRs can be manually marked for combination by adding a the 'select label' value and matching any branch name.
  • Dependabot PRs can be combined into groups by target branch or update source. For example, tag dependabot PRs for golang with go-dep and PRs for Docker with docker-dep, then combine go changes together and docker changes together.

Some notes on edge cases:

  • Both select_label and ignore_label may be set. In this case, the PR is only combined if it has a label matching select_label and does not have any label matching ignore_label.
  • If select_label == ignore_label, and error will be raise because it will be impossible for any PRs to be matched and this is almost certainly not what the developer intended.

@benCoomes benCoomes marked this pull request as ready for review March 27, 2023 15:48
@benCoomes
Copy link
Contributor Author

Would it be worth checking labels before CI or approvals, since label checks don't require additional API calls?

@GrantBirki
Copy link
Member

Would it be worth checking labels before CI or approvals, since label checks don't require additional API calls?

I think that would be a great idea! Could save some compute and a bit of time when executing this Action

@GrantBirki GrantBirki added the enhancement New feature or request label Mar 27, 2023
@GrantBirki
Copy link
Member

You can either make the change in this PR or we can merge and you can implement on a fresh PR. Up to you! I reviewed the code and it all looks good to me.

@benCoomes
Copy link
Contributor Author

Thanks! I'll switch the order of checks in a new PR to keep changes small. 🚀

@benCoomes benCoomes merged commit 288ea58 into main Mar 27, 2023
@benCoomes benCoomes deleted the select-label branch March 27, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants