Rebuild minimatch (#522)

* Rebuild minimatch and adapt changed interface

* Apply formatting

* Update minimatch license
This commit is contained in:
Milos Pantic
2023-03-23 10:45:05 +01:00
committed by GitHub
parent 72bf170dc0
commit 468a5e0250
5 changed files with 1560 additions and 938 deletions

View File

@@ -1,7 +1,7 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import * as yaml from 'js-yaml';
import {Minimatch, IMinimatch} from 'minimatch';
import {Minimatch} from 'minimatch';
interface MatchConfig {
all?: string[];
@@ -151,7 +151,7 @@ function toMatchConfig(config: StringOrMatchConfig): MatchConfig {
return config;
}
function printPattern(matcher: IMinimatch): string {
function printPattern(matcher: Minimatch): string {
return (matcher.negate ? '!' : '') + matcher.pattern;
}
@@ -169,7 +169,7 @@ export function checkGlobs(
return false;
}
function isMatch(changedFile: string, matchers: IMinimatch[]): boolean {
function isMatch(changedFile: string, matchers: Minimatch[]): boolean {
core.debug(` matching patterns against file ${changedFile}`);
for (const matcher of matchers) {
core.debug(` - ${printPattern(matcher)}`);