diff --git a/analyzers/cfn-lint/CI/circleci.yaml b/analyzers/cfn-lint/CI/circleci.yaml new file mode 100644 index 00000000..15dcdde2 --- /dev/null +++ b/analyzers/cfn-lint/CI/circleci.yaml @@ -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 \ No newline at end of file diff --git a/analyzers/cfn-lint/CI/gitlab-ci.yaml b/analyzers/cfn-lint/CI/gitlab-ci.yaml new file mode 100644 index 00000000..237f51ef --- /dev/null +++ b/analyzers/cfn-lint/CI/gitlab-ci.yaml @@ -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" \ No newline at end of file