Merge pull request #2 from actions/features/matcher

Add problem matcher
This commit is contained in:
Danny McCormick 2019-06-27 18:16:45 -04:00 committed by GitHub
commit 61f2387086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 3 deletions

16
.github/go.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "go",
"pattern": [
{
"regexp": "^([^:]*: )?((.:)?[^:]*):(\\d+)(:(\\d+))?: (.*)$",
"file": 2,
"line": 4,
"column": 6,
"message": 7
}
]
}
]
}

View File

@ -3,7 +3,7 @@
This action sets by Go environment for use in actions by: This action sets by Go environment for use in actions by:
- optionally downloading and caching a version of Go - optionally downloading and caching a version of Go
- TODO: registering problem matchers for error output - registering problem matchers for error output
- TODO: configuring proxy if the runner is configured to use a proxy (coming with private runners) - TODO: configuring proxy if the runner is configured to use a proxy (coming with private runners)
# License # License

View File

@ -17,6 +17,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core")); const core = __importStar(require("@actions/core"));
const installer = __importStar(require("./installer")); const installer = __importStar(require("./installer"));
const path = __importStar(require("path"));
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
@ -29,7 +30,8 @@ function run() {
yield installer.getGo(version); yield installer.getGo(version);
} }
// TODO: setup proxy from runner proxy config // TODO: setup proxy from runner proxy config
// TODO: problem matchers registered const matchersPath = path.join(__dirname, '..', '.github');
console.log(`##[add-matcher]${path.join(matchersPath, 'go.json')}`);
} }
catch (error) { catch (error) {
core.setFailed(error.message); core.setFailed(error.message);

View File

@ -1,5 +1,6 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as installer from './installer'; import * as installer from './installer';
import * as path from 'path';
async function run() { async function run() {
try { try {
@ -13,7 +14,9 @@ async function run() {
} }
// TODO: setup proxy from runner proxy config // TODO: setup proxy from runner proxy config
// TODO: problem matchers registered
const matchersPath = path.join(__dirname, '..', '.github');
console.log(`##[add-matcher]${path.join(matchersPath, 'go.json')}`);
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed(error.message);
} }