Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem matchers #7

Merged
merged 5 commits into from
Dec 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ignore all files by default
*
# include required files with an exception
!cfn-lint.json
!entrypoint.sh
!LICENSE
!README.md
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ LABEL "maintainer"="Scott Brenner <scott@scottbrenner.me>"
RUN apk --no-cache add python3
RUN pip3 install cfn-lint

COPY cfn-lint.json /cfn-lint.json
COPY entrypoint.sh /entrypoint.sh
RUN ["chmod", "+x", "/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This Action for [CloudFormation Linter](https://github.com/aws-cloudformation/cfn-python-lint/) enables arbitrary actions for interacting with CloudFormation Linter to validate CloudFormation yaml/json templates against the CloudFormation spec and additional checks. Includes checking valid values for resource properties and best practices.

![screenshot](screenshot.png)

## Usage

An example workflow for testing CloudFormation templates for correct properties and their values - run the `cfn-lint` command with the path to the files you want to test as `args`.
Expand Down
20 changes: 20 additions & 0 deletions cfn-lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"problemMatcher": [
{
"owner": "cfn-lint",
"pattern": [
{
"regexp": "^([EWI](\\d{4}))\\s(.+)$",
"code": 1,
"message": 3
},
{
"regexp": "^(\\S+):(\\d+):(\\d+)$",
"file": 1,
"line": 2,
"column": 3
}
]
}
]
}
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

set -e

# Copy the matcher to the host system; otherwise "add-matcher" can't find it.
cp /cfn-lint.json /github/workflow/cfn-lint.json
echo "::add-matcher::${RUNNER_TEMP}/_github_workflow/cfn-lint.json"

sh -c "cfn-lint $*"
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.