Skip to content

Commit 5f2246e

Browse files
author
Danny McCormick
committed
Add problem matcher
1 parent 886b49b commit 5f2246e

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

.github/go.json

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This action sets by Go environment for use in actions by:
44

55
- optionally downloading and caching a version of Go
6-
- TODO: registering problem matchers for error output
6+
- registering problem matchers for error output
77
- TODO: configuring proxy if the runner is configured to use a proxy (coming with private runners)
88

99
# License

lib/setup-go.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
1616
};
1717
Object.defineProperty(exports, "__esModule", { value: true });
1818
const core = __importStar(require("@actions/core"));
19-
// import * as installer from './installer';
19+
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 {
@@ -26,10 +27,11 @@ function run() {
2627
//
2728
const version = core.getInput('version');
2829
if (version) {
29-
// await installer.getGo(version);
30+
yield installer.getGo(version);
3031
}
3132
// TODO: setup proxy from runner proxy config
32-
// TODO: problem matchers registered
33+
const matchersPath = path.join(__dirname, '..', '.github');
34+
console.log(`##[add-matcher]${path.join(matchersPath, 'go.json')}`);
3335
}
3436
catch (error) {
3537
core.setFailed(error.message);

src/setup-go.ts

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

45
async function run() {
56
try {
@@ -9,11 +10,13 @@ async function run() {
910
//
1011
const version = core.getInput('version');
1112
if (version) {
12-
// await installer.getGo(version);
13+
await installer.getGo(version);
1314
}
1415

1516
// TODO: setup proxy from runner proxy config
16-
// TODO: problem matchers registered
17+
18+
const matchersPath = path.join(__dirname, '..', '.github');
19+
console.log(`##[add-matcher]${path.join(matchersPath, 'go.json')}`);
1720
} catch (error) {
1821
core.setFailed(error.message);
1922
}

0 commit comments

Comments
 (0)