-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90f9707
commit 15421eb
Showing
34 changed files
with
15,846 additions
and
189 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"env": { | ||
"commonjs": true, | ||
"es6": true, | ||
"jest": true, | ||
"node": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": 2018 | ||
}, | ||
"rules": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ main, v* ] | ||
pull_request: | ||
branches: [ main, v* ] | ||
schedule: | ||
- cron: '38 18 * * 3' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'javascript' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,63 @@ | ||
name: CI | ||
|
||
name: "Tests" | ||
on: | ||
push: | ||
branches: | ||
- master # Push events on master branch | ||
pull_request: # Run tests for any PRs | ||
|
||
env: | ||
IMAGE_NAME: cfn-lint-action | ||
|
||
branches: | ||
- main | ||
- ft/2.0.0 | ||
pull_request: | ||
jobs: | ||
# Run tests. | ||
test: | ||
unit: | ||
name: npm test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Docker build | ||
run: docker build . --file Dockerfile --tag image | ||
|
||
- name: Docker run | ||
run: docker run --entrypoint cfn-lint image -v | ||
|
||
lint: | ||
# Name the Job | ||
name: Lint Code Base | ||
# Set the agent to run on | ||
runs-on: ubuntu-latest | ||
|
||
################## | ||
# Load all steps # | ||
################## | ||
- uses: actions/setup-node@v2 | ||
- run: npm ci | ||
- run: npm test | ||
integ: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-18.04 | ||
- ubuntu-20.04 | ||
- windows-2016 | ||
- windows-2019 | ||
- macos-10.15 | ||
name: ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
########################## | ||
# Checkout the code base # | ||
########################## | ||
- name: Checkout Code | ||
# Step 1 | ||
- name: Git Checkout | ||
uses: actions/checkout@v2 | ||
|
||
################################ | ||
# Run Linter against code base # | ||
################################ | ||
- name: Lint Code Base | ||
uses: docker://github/super-linter:v2.2.0 | ||
env: | ||
VALIDATE_ALL_CODEBASE: true | ||
|
||
# Push image to GitHub Packages. | ||
# See also https://docs.docker.com/docker-hub/builds/ | ||
push: | ||
# Ensure test job passes before pushing image. | ||
needs: test | ||
|
||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build image | ||
run: docker build . --file Dockerfile --tag $IMAGE_NAME | ||
|
||
- name: Log into GitHub Container Registry | ||
run: echo "${{ secrets.CFN_CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- name: Push image to GitHub Container Registry | ||
# Step 2 | ||
- name: Setup Cloud Formation Linter with Latest Version | ||
uses: ./ | ||
# Step 3 | ||
- name: Print the Cloud Formation Linter Version & run Linter. | ||
run: | | ||
cfn-lint --version | ||
cfn-lint -t ./examples/template.yml | ||
# Step 4 | ||
- name: Setup Cloud Formation Linter with Specific Version | ||
uses: ./ | ||
with: | ||
version: "0.44.5" | ||
# Step 5 | ||
- name: Print the Cloud Formation Linter Version & run Linter. | ||
run: | | ||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | ||
# Change all uppercase to lowercase | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
SHA="${{ github.sha }}" | ||
# Strip git ref prefix from version | ||
REF=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo SHA=$SHA | ||
echo REF=$REF | ||
docker tag $IMAGE_NAME $IMAGE_ID:$SHA | ||
docker tag $IMAGE_NAME $IMAGE_ID:$REF | ||
docker push $IMAGE_ID:$SHA | ||
docker push $IMAGE_ID:$REF | ||
cfn-lint --version | ||
cfn-lint -t ./examples/template.yml | ||
# Step 6 | ||
### Testing specifying a version and command | ||
- name: Testing with CFN Lint Version & Command | ||
uses: ./ | ||
with: | ||
command: cfn-lint -t ./examples/template.yml | ||
version: "0.44.5" | ||
# Step 7 | ||
### Testing specifying a version and command | ||
- name: Testing with CFN Lint Command | ||
uses: ./ | ||
with: | ||
command: cfn-lint -t ./examples/template.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
coverage | ||
dist | ||
examples | ||
.github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Changelog | ||
|
||
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.0.0](https://github.com/ScottBrenner/cfn-lint-action/releases/tag/v2.0.0) | ||
|
||
### Added | ||
|
||
- GitHub Action is now written in JavaScript. | ||
- Unit Tests (90% Coverage). | ||
- User can now specify any command they need to run. | ||
|
||
### Removed | ||
|
||
- The default functionality to run a command. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.