Skip to content

Commit

Permalink
Revert "breaking: Version 2.0.0 (#33)"
Browse files Browse the repository at this point in the history
This reverts commit 15421eb.
  • Loading branch information
ScottBrenner authored Apr 20, 2021
1 parent 15421eb commit 1d8a84f
Show file tree
Hide file tree
Showing 34 changed files with 189 additions and 15,846 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ignore all files by default
*
# include required files with an exception
!cfn-lint.json
!entrypoint.sh
!LICENSE
!README.md
!THIRD_PARTY_NOTICE.md
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

13 changes: 0 additions & 13 deletions .eslintrc.json

This file was deleted.

5 changes: 3 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ updates:
schedule:
interval: "weekly"

# Enable version updates for npm
- package-ecosystem: "npm"
# Enable version updates for Docker
- package-ecosystem: "docker"
# Look for a `Dockerfile` in the `root` directory
directory: "/"
# Check for updates once a week
schedule:
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

127 changes: 73 additions & 54 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,82 @@
name: "Tests"
name: CI

on:
push:
branches:
- main
- ft/2.0.0
pull_request:
branches:
- master # Push events on master branch
pull_request: # Run tests for any PRs

env:
IMAGE_NAME: cfn-lint-action

jobs:
unit:
name: npm test
# Run tests.
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- 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 }}

- 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 #
##################
steps:
# Step 1
- name: Git Checkout
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2
# 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 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
run: |
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
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
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierignore

This file was deleted.

18 changes: 0 additions & 18 deletions CHANGELOG.md

This file was deleted.

23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.9.4-alpine

LABEL name="cfn-lint-action"
LABEL repository="https://github.com/ScottBrenner/cfn-lint-action"
LABEL homepage="https://github.com/ScottBrenner/cfn-lint-action"
LABEL org.opencontainers.image.source="https://github.com/ScottBrenner/cfn-lint-action"

LABEL "com.github.actions.name"="cfn-lint-action"
LABEL "com.github.actions.description"="GitHub Action for CloudFormation Linter"
LABEL "com.github.actions.icon"="box"
LABEL "com.github.actions.color"="green"

LABEL "maintainer"="Scott Brenner <[email protected]>"

RUN pip install cfn-lint --no-cache-dir
RUN cfn-lint --update-specs
RUN cfn-lint --update-iam-policies

COPY cfn-lint.json /cfn-lint.json
COPY entrypoint.sh /entrypoint.sh
RUN ["chmod", "+x", "/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["**/*.yml"]
Loading

0 comments on commit 1d8a84f

Please sign in to comment.