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

feat: add CircleCI, Gitlab CI snippet for cfn-lint #27

Merged
merged 3 commits into from
Feb 6, 2024
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
29 changes: 29 additions & 0 deletions analyzers/cfn-lint/CI/circleci.yaml
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
14 changes: 14 additions & 0 deletions analyzers/cfn-lint/CI/gitlab-ci.yaml
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"
Loading