Run build and fix bad merge

This commit is contained in:
Josh Dales
2023-03-23 09:08:08 -04:00
parent 8e6367ddee
commit 9bfc9998ab
2 changed files with 937 additions and 1564 deletions

2470
dist/index.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,6 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import * as yaml from 'js-yaml';
import {Minimatch} from 'minimatch';
import {
ChangedFilesMatchConfig,
@@ -128,33 +127,27 @@ function getLabelConfigMapFromObject(
return labelMap;
}
function printPattern(matcher: Minimatch): string {
return (matcher.negate ? '!' : '') + matcher.pattern;
export function toMatchConfig(config: any): MatchConfig {
const changedFilesConfig = toChangedFilesMatchConfig(config);
const branchConfig = toBranchMatchConfig(config);
return {
...changedFilesConfig,
...branchConfig
};
}
export function checkMatchConfigs(
changedFiles: string[],
matchConfigs: MatchConfig[]
): boolean {
for (const glob of globs) {
core.debug(` checking pattern ${JSON.stringify(glob)}`);
const matchConfig = toMatchConfig(glob);
if (checkMatch(changedFiles, matchConfig)) {
return true;
}
}
return false;
}
function isMatch(changedFile: string, matchers: Minimatch[]): boolean {
core.debug(` matching patterns against file ${changedFile}`);
for (const matcher of matchers) {
core.debug(` - ${printPattern(matcher)}`);
if (!matcher.match(changedFile)) {
core.debug(` ${printPattern(matcher)} did not match`);
for (const config of matchConfigs) {
core.debug(` checking config ${JSON.stringify(config)}`);
if (!checkMatch(changedFiles, config)) {
return false;
}
}
return true;
}