diff --git a/dist/gcc_matcher.jsontemplate b/dist/gcc_matcher.jsontemplate index 9019aee..0e2dac5 100644 --- a/dist/gcc_matcher.jsontemplate +++ b/dist/gcc_matcher.jsontemplate @@ -4,7 +4,7 @@ "owner": "gcc-problem-matcher", "pattern": [ { - "regexp": "^(${{ BASE }})(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "regexp": "^(${{ BASE }}\\/?)(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", "fromPath": 1, "file": 2, "line": 3, diff --git a/dist/index.js b/dist/index.js index ab975fa..cae0340 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2848,7 +2848,7 @@ const core = __nccwpck_require__(127); // escapeRegExp :: string => string // escape all characters with special meanings in regexp const escapeRegExp = (s) => - s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\$&"); + s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\\\$&"); // variable :: string => RegExp // create regex to match ${{ key }} @@ -2859,7 +2859,7 @@ const variable = (key) => const templatePath = __nccwpck_require__.ab + "gcc_matcher.jsontemplate"; // matcherPath :: string -const matcherPath = __nccwpck_require__.ab + "gcc_matcher.json"; +const outputPath = __nccwpck_require__.ab + "gcc_matcher.json"; // rootdir :: string const rootdir = core.getInput('build-directory', {required: false}); diff --git a/src/gcc_matcher.jsontemplate b/src/gcc_matcher.jsontemplate index 9019aee..0e2dac5 100644 --- a/src/gcc_matcher.jsontemplate +++ b/src/gcc_matcher.jsontemplate @@ -4,7 +4,7 @@ "owner": "gcc-problem-matcher", "pattern": [ { - "regexp": "^(${{ BASE }})(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "regexp": "^(${{ BASE }}\\/?)(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", "fromPath": 1, "file": 2, "line": 3, diff --git a/src/index.js b/src/index.js index b58216e..6ff6211 100644 --- a/src/index.js +++ b/src/index.js @@ -5,7 +5,7 @@ const core = require('@actions/core'); // escapeRegExp :: string => string // escape all characters with special meanings in regexp const escapeRegExp = (s) => - s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\$&"); + s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\\\$&"); // variable :: string => RegExp // create regex to match ${{ key }} @@ -16,7 +16,7 @@ const variable = (key) => const templatePath = path.join(__dirname, "gcc_matcher.jsontemplate"); // matcherPath :: string -const matcherPath = path.join(__dirname, "gcc_matcher.json"); +const outputPath = path.join(__dirname, "gcc_matcher.json"); // rootdir :: string const rootdir = core.getInput('build-directory', {required: false}); @@ -34,7 +34,7 @@ const parse = (templatePath) => (matcherPath) => { // main: try { - parse(templatePath)(matcherPath); + parse(templatePath)(outputPath); } catch (err) { core.setFailed(`Action failed with error ${err}`) }