mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 03:58:05 +00:00
Simplfy the conditions in toBranchMatchConfig
This commit is contained in:
@@ -18,17 +18,9 @@ export function toBranchMatchConfig(config: any): BranchMatchConfig {
|
||||
baseBranch: config['base-branch']
|
||||
};
|
||||
|
||||
if (branchConfig.headBranch) {
|
||||
const patterns = branchConfig.headBranch;
|
||||
if (typeof patterns === 'string') {
|
||||
branchConfig.headBranch = [patterns];
|
||||
}
|
||||
}
|
||||
|
||||
if (branchConfig.baseBranch) {
|
||||
const patterns = branchConfig.baseBranch;
|
||||
if (typeof patterns === 'string') {
|
||||
branchConfig.baseBranch = [patterns];
|
||||
for (const branchName in branchConfig) {
|
||||
if (typeof branchConfig[branchName] === 'string') {
|
||||
branchConfig[branchName] = [branchConfig[branchName]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user