From a2690b95014199a3cdb3f388606e341f4d468606 Mon Sep 17 00:00:00 2001 From: r7kamura Date: Thu, 30 May 2024 09:05:27 +0900 Subject: [PATCH] Add problem matchers for `deno lint` --- deno-problem-matchers.json | 21 +++++++++++++++++++++ main.mjs | 7 +++++++ 2 files changed, 28 insertions(+) create mode 100644 deno-problem-matchers.json diff --git a/deno-problem-matchers.json b/deno-problem-matchers.json new file mode 100644 index 00000000..1e95f83b --- /dev/null +++ b/deno-problem-matchers.json @@ -0,0 +1,21 @@ +{ + "problemMatcher": [ + { + "owner": "deno-lint", + "pattern": [ + { + "regexp": "^(?:\\x1B\\[[0-9;]*[a-zA-Z])*(warning|warn|error)(?:\\[(\\S*)\\])?(?:\\x1B\\[[0-9;]*[a-zA-Z])*: (.*?)(?:\\x1B\\[[0-9;]*[a-zA-Z])*$", + "severity": 1, + "code": 2, + "message": 3 + }, + { + "regexp": "^(?:\\s*)(?:\\x1B\\[[0-9;]*[a-zA-Z])*-->(?:\\x1B\\[[0-9;]*[a-zA-Z])* (?:\\x1B\\[[0-9;]*[a-zA-Z])*(\\S+?)(?:\\x1B\\[[0-9;]*[a-zA-Z])*:(\\d+):(\\d+)(?:\\x1B\\[[0-9;]*[a-zA-Z])*$", + "file": 1, + "line": 2, + "column": 3 + } + ] + } + ] +} diff --git a/main.mjs b/main.mjs index 9e59fd89..6ca43a9f 100644 --- a/main.mjs +++ b/main.mjs @@ -1,5 +1,6 @@ import process from "node:process"; import core from "@actions/core"; +import path from "node:path"; import { getDenoVersionFromFile, parseVersionRange, @@ -38,6 +39,12 @@ async function main() { await install(version); + core.info( + `::add-matcher::${ + path.join(import.meta.dirname ?? ".", "deno-problem-matchers.json") + }`, + ); + core.setOutput("deno-version", version.version); core.setOutput("release-channel", version.kind);