-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add CircleCI, Gitlab CI snippet for cfn-lint (#27)
- Loading branch information
1 parent
0c203c5
commit d824f2b
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
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,29 @@ | ||
version: 2.1 | ||
|
||
jobs: | ||
run-cfn-lint: | ||
docker: | ||
- image: cimg/python:3.12 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install cfn-lint | ||
command: | | ||
python -m pip install --upgrade pip | ||
pip3 install cfn-lint | ||
- run: | ||
name: Run cfn-lint | ||
command: | | ||
cfn-lint -t ./**/*.yaml -f sarif > cfn-lint.sarif || true | ||
- run: | ||
name: Upload SARIF report to DeepSource | ||
command: | | ||
# Install the DeepSource CLI | ||
curl https://deepsource.io/cli | sh | ||
# Send the report to DeepSource | ||
./bin/deepsource report --analyzer cfn-lint --analyzer-type community --value-file ./cfn-lint.sarif | ||
workflows: | ||
run-cfn-lint-workflow: | ||
jobs: | ||
- run-cfn-lint |
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,14 @@ | ||
stages: | ||
- scan | ||
|
||
scan: | ||
stage: scan | ||
image: python:latest # Using Python image because cfn-lint is a Python package | ||
before_script: | ||
- pip install cfn-lint # Install cfn-lint | ||
script: | ||
- cfn-lint -t ./**/*.yaml -f sarif > cfn-lint.sarif || true # Run cfn-lint and generate SARIF report | ||
- curl -sSL https://deepsource.io/cli | sh # Install DeepSource CLI | ||
- ./bin/deepsource report --analyzer cfn-lint --analyzer-type community --value-file ./cfn-lint.sarif # Upload SARIF report to DeepSource | ||
rules: | ||
- if: $CI_PIPELINE_SOURCE == "push" |