Skip to content

Commit c6f6323

Browse files
committed
feat: register problem matcher on action
1 parent bab7b00 commit c6f6323

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

dist/setup/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100791,6 +100791,11 @@ const qualityOptions = [
100791100791
'preview',
100792100792
'ga'
100793100793
];
100794+
/**
100795+
* The problem matcher files to be registered with the runner.
100796+
* https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md
100797+
*/
100798+
const problemMatchers = ['csc.json', 'dotnet-format.json'];
100794100799
async function run() {
100795100800
try {
100796100801
//
@@ -100847,8 +100852,9 @@ async function run() {
100847100852
const cacheDependencyPath = core.getInput('cache-dependency-path');
100848100853
await (0, cache_restore_1.restoreCache)(cacheDependencyPath);
100849100854
}
100850-
const matchersPath = path_1.default.join(__dirname, '..', '..', '.github');
100851-
core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`);
100855+
for (const file of problemMatchers) {
100856+
core.info(`##[add-matcher]${path_1.default.join(__dirname, '..', '..', '.github', file)}`);
100857+
}
100852100858
}
100853100859
catch (error) {
100854100860
core.setFailed(error.message);

src/setup-dotnet.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ const qualityOptions = [
1919

2020
export type QualityOptions = (typeof qualityOptions)[number];
2121

22+
/**
23+
* The problem matcher files to be registered with the runner.
24+
* https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md
25+
*/
26+
const problemMatchers = ['csc.json', 'dotnet-format.json'];
27+
2228
export async function run() {
2329
try {
2430
//
@@ -89,8 +95,11 @@ export async function run() {
8995
await restoreCache(cacheDependencyPath);
9096
}
9197

92-
const matchersPath = path.join(__dirname, '..', '..', '.github');
93-
core.info(`##[add-matcher]${path.join(matchersPath, 'csc.json')}`);
98+
for (const file of problemMatchers) {
99+
core.info(
100+
`##[add-matcher]${path.join(__dirname, '..', '..', '.github', file)}`
101+
);
102+
}
94103
} catch (error) {
95104
core.setFailed(error.message);
96105
}

0 commit comments

Comments
 (0)