Skip to content

Commit 2f6f030

Browse files
committed
Adjust regex
1 parent cb946ec commit 2f6f030

File tree

1 file changed

+4
-5
lines changed
  • .github/actions/https-everywhere-labeller

1 file changed

+4
-5
lines changed

.github/actions/https-everywhere-labeller/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const github = require('@actions/github');
55
const axios = require('axios');
66
const unzip = require('unzipper');
77
const 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

1111
let ProgressBar = require('progress');
1212
let 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

Comments
 (0)