mirror of
https://github.com/actions/labeler.git
synced 2025-12-14 13:47:02 +00:00
Remove the branch option and replace with just head-branch and base-branch
This commit is contained in:
@@ -3,12 +3,11 @@ import * as github from '@actions/github';
|
||||
import * as yaml from 'js-yaml';
|
||||
import {Minimatch, IMinimatch} from 'minimatch';
|
||||
|
||||
import {checkBranch} from './branch';
|
||||
import {checkBranch, toMatchConfigWithBranches} from './branch';
|
||||
|
||||
interface MatchConfig {
|
||||
all?: string[];
|
||||
any?: string[];
|
||||
branch?: string[];
|
||||
headBranch?: string[];
|
||||
baseBranch?: string[];
|
||||
}
|
||||
@@ -151,14 +150,9 @@ function toMatchConfig(config: StringOrMatchConfig): MatchConfig {
|
||||
return {
|
||||
any: [config]
|
||||
};
|
||||
} else if (typeof config.branch === 'string') {
|
||||
return {
|
||||
...config,
|
||||
branch: [config.branch]
|
||||
};
|
||||
}
|
||||
|
||||
return config;
|
||||
return toMatchConfigWithBranches(config);
|
||||
}
|
||||
|
||||
function printPattern(matcher: IMinimatch): string {
|
||||
@@ -236,12 +230,6 @@ function checkMatch(changedFiles: string[], matchConfig: MatchConfig): boolean {
|
||||
}
|
||||
}
|
||||
|
||||
if (matchConfig.branch !== undefined) {
|
||||
if (!checkBranch(matchConfig.branch)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (matchConfig.headBranch !== undefined) {
|
||||
if (!checkBranch(matchConfig.headBranch, 'head')) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user