mirror of
https://github.com/actions/labeler.git
synced 2025-12-14 13:47:02 +00:00
Create new interfaces for MatchConfig
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as github from '@actions/github';
|
||||
|
||||
export interface BranchMatchConfig {
|
||||
headBranch?: string[];
|
||||
baseBranch?: string[];
|
||||
}
|
||||
|
||||
type BranchBase = 'base' | 'head';
|
||||
|
||||
export function toMatchConfigWithBranches(config: any) {
|
||||
export function toBranchMatchConfig(config: any): BranchMatchConfig {
|
||||
if (!config['head-branch'] || config['base-branch']) {
|
||||
return config;
|
||||
}
|
||||
@@ -27,12 +32,7 @@ export function toMatchConfigWithBranches(config: any) {
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...config,
|
||||
['head-branch']: undefined,
|
||||
['base-branch']: undefined,
|
||||
...branchConfig
|
||||
};
|
||||
return branchConfig;
|
||||
}
|
||||
|
||||
export function getBranchName(branchBase?: BranchBase): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user