Skip to content

Commit f87656b

Browse files
committed
feat: allow folder of problem matcher registration
Allows registering of new problem matchers by adding them to folder
1 parent 59e61b8 commit f87656b

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

dist/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4632,6 +4632,7 @@ const installer = __importStar(__webpack_require__(749));
46324632
const auth = __importStar(__webpack_require__(202));
46334633
const path = __importStar(__webpack_require__(622));
46344634
const url_1 = __webpack_require__(835);
4635+
const fs = __importStar(__webpack_require__(747));
46354636
function run() {
46364637
return __awaiter(this, void 0, void 0, function* () {
46374638
try {
@@ -4655,10 +4656,12 @@ function run() {
46554656
if (registryUrl) {
46564657
auth.configAuthentication(registryUrl, alwaysAuth);
46574658
}
4658-
const matchersPath = path.join(__dirname, '..', '.github');
4659-
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
4660-
console.log(`##[add-matcher]${path.join(matchersPath, 'eslint-stylish.json')}`);
4661-
console.log(`##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}`);
4659+
// Iterate and register all problem matchers
4660+
const matchersPath = path.join(__dirname, '..', 'matchers');
4661+
const matchers = fs.readdirSync(matchersPath);
4662+
matchers.forEach(matcher => {
4663+
console.log(`##[add-matcher]${path.join(matchersPath, matcher)}`);
4664+
});
46624665
}
46634666
catch (error) {
46644667
core.setFailed(error.message);
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/main.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as installer from './installer';
33
import * as auth from './authutil';
44
import * as path from 'path';
55
import {URL} from 'url';
6+
import * as fs from 'fs';
67

78
export async function run() {
89
try {
@@ -30,14 +31,12 @@ export async function run() {
3031
auth.configAuthentication(registryUrl, alwaysAuth);
3132
}
3233

33-
const matchersPath = path.join(__dirname, '..', '.github');
34-
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
35-
console.log(
36-
`##[add-matcher]${path.join(matchersPath, 'eslint-stylish.json')}`
37-
);
38-
console.log(
39-
`##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}`
40-
);
34+
// Iterate and register all problem matchers
35+
const matchersPath = path.join(__dirname, '..', 'matchers');
36+
const matchers = fs.readdirSync(matchersPath);
37+
matchers.forEach(matcher => {
38+
console.log(`##[add-matcher]${path.join(matchersPath, matcher)}`);
39+
});
4140
} catch (error) {
4241
core.setFailed(error.message);
4342
}

0 commit comments

Comments
 (0)