Skip to content

Commit 4fa0fd2

Browse files
author
Danny McCormick
authored
Add problem matcher (#4)
1 parent 9242e91 commit 4fa0fd2

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

.github/java.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "java",
5+
"pattern": [
6+
{
7+
"regexp": "^Exception in thread \"(.*)\" (.*): (.*)$",
8+
"code": 2,
9+
"message": 3
10+
}
11+
]
12+
}
13+
]
14+
}

lib/setup-java.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
1717
Object.defineProperty(exports, "__esModule", { value: true });
1818
const core = __importStar(require("@actions/core"));
1919
const installer = __importStar(require("./installer"));
20+
const path = __importStar(require("path"));
2021
function run() {
2122
return __awaiter(this, void 0, void 0, function* () {
2223
try {
2324
const version = core.getInput('version', { required: true });
2425
const arch = core.getInput('architecture', { required: true });
2526
const jdkFile = core.getInput('jdkFile', { required: true });
2627
yield installer.getJava(version, arch, jdkFile);
28+
const matchersPath = path.join(__dirname, '..', '.github');
29+
console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
2730
}
2831
catch (error) {
2932
core.setFailed(error.message);

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/setup-java.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as core from '@actions/core';
22
import * as installer from './installer';
3+
import * as path from 'path';
34

45
async function run() {
56
try {
@@ -8,6 +9,9 @@ async function run() {
89
const jdkFile = core.getInput('jdkFile', {required: true});
910

1011
await installer.getJava(version, arch, jdkFile);
12+
13+
const matchersPath = path.join(__dirname, '..', '.github');
14+
console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
1115
} catch (error) {
1216
core.setFailed(error.message);
1317
}

0 commit comments

Comments
 (0)