forked from actions/labeler
-
Notifications
You must be signed in to change notification settings - Fork 3
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
New config structure for labeler #3
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Start of a new config structure for the
labeler
action - it no longer defaults to checking paths, you need to specifychanged-files
in your labeler config file. Also addshead-branch
andbase-branch
options for adding labels based on those branch names.Also moves all the branch checking related logic into it's own file and adds unit tests for that.
This is what the
labeler.yml
will end up looking like after these changes:🤔 I'm trying not to refactor more of this than I need to - but I wonder if this as it is is potentially going to make things a little bit more confusing for a while, partly because it was all written around the sole option of file changes and now that is not the only way to use this action. So there are things like globs being referenced in a lot of function names which is kinda weird now.
And because we have nested options now and not each matchconfig individually in it's own item as a part of the map I'm reversing the conditions of
checkMatch
so that if any condition is successful then we apply the label rather than checking for all the options and if any fails then return.