Skip to content

Commit 6ba1ab0

Browse files
committed
Add Problem Matcher
1 parent 0fd7944 commit 6ba1ab0

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

.github/matchers.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "tflint-compact",
5+
"pattern": [
6+
{
7+
"regexp": "^(.+):(\\d+):(\\d+):\\s(Error|Warning|Notice)\\s-\\s(.+)\\s\\((.+)\\)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"severity": 4,
12+
"message": 5,
13+
"code": 6
14+
}
15+
]
16+
}
17+
]
18+
}

.github/workflows/test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,20 @@ jobs:
5959
- name: Validate
6060
if: matrix.tflint_version == 'latest'
6161
run: tflint -v
62+
63+
integration-matchers:
64+
name: 'Integration test (tflint_version: ${{ matrix.tflint_version }})'
65+
runs-on: ubuntu-latest
66+
strategy:
67+
matrix:
68+
tflint_version: ['v0.26.0', latest]
69+
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v2
73+
- name: Use Action
74+
uses: ./
75+
with:
76+
tflint_version: ${{ matrix.tflint_version }}
77+
- name: Run
78+
run: tflint -f compact --force

example.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resource "aws_instance" "foo" {
2+
instance_type = "t1.2xlarge"
3+
}

src/setup-tflint.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const os = require('os');
2+
const path = require('path');
23

34
const core = require('@actions/core');
45
const tc = require('@actions/tool-cache');
@@ -84,6 +85,9 @@ async function run() {
8485

8586
core.addPath(pathToCLI);
8687

88+
const matchersPath = path.join(__dirname, '..', '.github');
89+
core.info(`##[add-matcher]${path.join(matchersPath, 'matchers.json')}`);
90+
8791
return version;
8892
} catch (ex) {
8993
core.error(ex);

0 commit comments

Comments
 (0)