diff --git a/.github/cfn-lint-pull-request.png b/.github/cfn-lint-pull-request.png new file mode 100644 index 0000000..471d7c8 Binary files /dev/null and b/.github/cfn-lint-pull-request.png differ diff --git a/.github/cfn-lint.json b/.github/cfn-lint.json new file mode 100644 index 0000000..98d4fbe --- /dev/null +++ b/.github/cfn-lint.json @@ -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 + } + ] + } + ] +} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 59a7cd2..815cc4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,8 @@ on: push: branches: - main - - ft/2.0.0 + - feature/** + - bug/** pull_request: jobs: unit: diff --git a/.husky/pre-commit b/.husky/pre-commit index 36af219..d8034aa 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,3 +2,4 @@ . "$(dirname "$0")/_/husky.sh" npx lint-staged +npm run all diff --git a/CHANGELOG.md b/CHANGELOG.md index cd5c074..2771259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.1.0](https://github.com/ScottBrenner/cfn-lint-action/releases/tag/v2.1.0) + +### Added + +- Cloud FormationLinter [Problem Matchers](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md). +- Pre-Commit Hook for running `npm run all` to ensure the software is automatically re-built on changes. + +### Changed + +- Metadata cleanup within `package.json` to better align with software. + ## [2.0.1](https://github.com/ScottBrenner/cfn-lint-action/releases/tag/v2.0.1) ### Changed diff --git a/README.md b/README.md index e71090f..ce29a92 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ This Action for [CloudFormation Linter](https://github.com/aws-cloudformation/cf The Action's primary purpose is to set the [CloudFormation Linter](https://github.com/aws-cloudformation/cfn-python-lint/) to the runner's $PATH so you can access the linter throughout the workflow, and use in a way that suits your application. There is a way to run a [CloudFormation Linter](https://github.com/aws-cloudformation/cfn-python-lint/) command in this workflow though if you like. +On a pull request, once this GitHub Action is set-up, it may look something like this: + +![Output of Cloud Formation Linter](.github/cfn-lint-pull-request.png?raw=true "Output of Cloud Formation Linter") + ## Usage There are multiple ways to consume this GitHub Action. diff --git a/action.yml b/action.yml index 0771332..45ee272 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ -name: "Setup AWS CFN LINT" -description: "Setup AWS CFN LINT and add it to the PATH" +name: "cfn-lint-action" +description: "Setup Amazon CloudFormation Linter (cfn-lint)" branding: icon: "terminal" color: "orange" diff --git a/dist/index.js b/dist/index.js index bd9eef8..0059978 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6,12 +6,15 @@ module.exports = /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { const core = __nccwpck_require__(186); +const path = __nccwpck_require__(622); const setup = __nccwpck_require__(391); (async () => { try { await setup(); + const matchersPath = path.join(__dirname, "..", ".github"); + core.info(`##[add-matcher]${path.join(matchersPath, "cfn-lint.json")}`); } catch (error) { core.setFailed(error.message); } diff --git a/index.js b/index.js index 55edb00..ced4e9f 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,13 @@ const core = require("@actions/core"); +const path = require("path"); const setup = require("./lib/setup"); (async () => { try { await setup(); + const matchersPath = path.join(__dirname, "..", ".github"); + core.info(`##[add-matcher]${path.join(matchersPath, "cfn-lint.json")}`); } catch (error) { core.setFailed(error.message); } diff --git a/package.json b/package.json index 70bc430..d4d3f1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "setup-cfn-lint", - "version": "0.1.0", + "name": "cfn-lint-action", + "version": "2.1.0", "private": true, "description": "Action to setup CloudFormation to the the PATH", "main": "index.js", @@ -11,7 +11,7 @@ "all": "npm run format && npm test && npm run build", "prepare": "husky install" }, - "license": "Apache-2.0", + "license": "MIT License", "dependencies": { "@actions/core": "^1.2.6", "@actions/exec": "^1.0.4",