@@ -5,8 +5,8 @@ const github = require('@actions/github');
55const axios = require ( 'axios' ) ;
66const unzip = require ( 'unzipper' ) ;
77const context = github . context ;
8- const minimatch = require ( 'minimatch' ) ;
9- const rulesetGlob = new minimatch . Minimatch ( '/src/chrome/content/rules/*.xml' ) ;
8+ const minimatch = require ( 'minimatch' ) . Minimatch ;
9+ const rulesetGlob = '/src/chrome/content/rules/*.xml' ;
1010
1111let ProgressBar = require ( 'progress' ) ;
1212let alexaLabels = [ 'top-1m' , 'top-100k' , 'top-10k' , 'top-1k' , 'top-100' ] ;
@@ -95,14 +95,13 @@ async function run(alexa) {
9595 const fileList = response . data
9696 console . log ( fileList ) ;
9797
98- if ( ! fileList . every ( file => rulesetGlob . match ( file . filename ) ) ) {
98+ if ( ! fileList . every ( file => minimatch . match ( file . filename , rulesetGlob , { matchBase : true } ) ) ) {
9999 // Don't touch PRs that modify anything except rulesets
100- console . log ( rulesetGlob ) ;
101100 console . log ( 'No ruleset files in this PR' ) ;
102101 return ;
103102 } else {
104103 fileList . forEach ( file => {
105- if ( rulesetGlob . match ( file . filename ) !== null ) {
104+ if ( minimatch . match ( file . filename , rulesetGlob , { matchBase : true } ) ) {
106105 console . log ( 'passed match' ) ;
107106
108107 // Look at PR changes directly
0 commit comments