File tree Expand file tree Collapse file tree 2 files changed +8
-18
lines changed
Expand file tree Collapse file tree 2 files changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,18 @@ see [configuration](#configuration) below for more.
1717 ` https://<filter_url>/1234/ABCDWXYZ ` (note: no ` /github ` ) in the GitHub webhook settings:\
1818 ![ settings] ( ./.github/assets/github-settings.png )
19193 . Optionally add configuration parameters (see below) to the URL, e.g.
20- ` ?allowBranches=master, dev&hideTags=1 ` .
20+ ` ?allowBranches=master| dev&hideTags=1 ` .
21214 . ????
22225 . Profit!
2323
2424## Configuration
2525
2626Additional options can be configured per URL:
2727
28- - Only forward events from specific branches ( ` allowBranches ` , simplified wildcard syntax)
29- - ` abc*xyz ` is equivalent to ` /^(abc.*xyz)$/ `
30- - ` stuff,things ` is equivalent to ` /^(stuff|things)$/ `
31- - ` !oh*hi*there ` is equivalent to ` /^(oh.*hi.*there )$/ ` inverted
32- - Ignore tag updates ( ` hideTags ` )
33- - Ignore burst PR review comments in a short timespan, only showing the first x comments per review
34- ( ` commentBurstLimit ` )
28+ - ` allowBranches ` : Only forward events from specific branches
29+ - This is case-sensitive and supports regex
30+ - Only full matches are considered, i.e. no substrings; ` abc.*xyz ` is equivalent to
31+ ` /^(abc.*xyz )$/ `
32+ - ` hideTags ` : Ignore tag updates
33+ - ` commentBurstLimit ` : Ignore burst PR review comments in a short timespan, only showing the first x
34+ comments per review
Original file line number Diff line number Diff line change @@ -8,22 +8,12 @@ export function sleep(ms: number): Promise<void> {
88 return new Promise ( ( resolve ) => setTimeout ( resolve , ms ) ) ;
99}
1010
11- function _escapeRegex ( pattern : string ) : string {
12- return pattern . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, "\\$&" ) ;
13- }
14-
1511export function wildcardMatch ( pattern : string , target : string ) : boolean {
1612 let invert = false ;
1713 if ( pattern [ 0 ] === "!" ) {
1814 invert = true ;
1915 pattern = pattern . slice ( 1 ) ;
2016 }
21-
22- // allow `*` wildcard specifier, translate to `.*` regex;
23- // escape everything else
24- pattern = pattern . split ( "*" ) . map ( _escapeRegex ) . join ( ".*" ) ;
25- // treat `,` as `|`
26- pattern = pattern . replaceAll ( "," , "|" ) ;
2717 // add anchors
2818 pattern = `^(${ pattern } )$` ;
2919
You can’t perform that action at this time.
0 commit comments