From 16e40a26d71a4ef76584dd439e8eb8692418287a Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Mon, 13 Jan 2025 20:49:34 +0900 Subject: [PATCH] feat: register problem matcher on action --- dist/setup/index.js | 10 ++++++++-- src/setup-dotnet.ts | 13 +++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index d415cbd..8cbadd2 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -94047,6 +94047,11 @@ const qualityOptions = [ 'preview', 'ga' ]; +/** + * The problem matcher files to be registered with the runner. + * https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md + */ +const problemMatchers = ['csc.json', 'dotnet-format.json']; function run() { return __awaiter(this, void 0, void 0, function* () { try { @@ -94104,8 +94109,9 @@ function run() { const cacheDependencyPath = core.getInput('cache-dependency-path'); yield (0, cache_restore_1.restoreCache)(cacheDependencyPath); } - const matchersPath = path_1.default.join(__dirname, '..', '..', '.github'); - core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`); + for (const file of problemMatchers) { + core.info(`##[add-matcher]${path_1.default.join(__dirname, '..', '..', '.github', file)}`); + } } catch (error) { core.setFailed(error.message); diff --git a/src/setup-dotnet.ts b/src/setup-dotnet.ts index 2a628a5..dfbabad 100644 --- a/src/setup-dotnet.ts +++ b/src/setup-dotnet.ts @@ -19,6 +19,12 @@ const qualityOptions = [ export type QualityOptions = (typeof qualityOptions)[number]; +/** + * The problem matcher files to be registered with the runner. + * https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md + */ +const problemMatchers = ['csc.json', 'dotnet-format.json']; + export async function run() { try { // @@ -89,8 +95,11 @@ export async function run() { await restoreCache(cacheDependencyPath); } - const matchersPath = path.join(__dirname, '..', '..', '.github'); - core.info(`##[add-matcher]${path.join(matchersPath, 'csc.json')}`); + for (const file of problemMatchers) { + core.info( + `##[add-matcher]${path.join(__dirname, '..', '..', '.github', file)}` + ); + } } catch (error) { core.setFailed(error.message); }