Skip to content

Commit

Permalink
Added Code Checks Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-makarevich-clearscale committed Jan 4, 2024
1 parent 4308dbd commit 18c6ace
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Terraform Lint
on:
push:
branches: [ main, develop, workflow_dispatch ]
pull_request:

jobs:
tflint:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v3
name: Checkout source code

- uses: terraform-linters/setup-tflint@v4
name: Setup TFLint

- name: Show version
run: tflint --version

- name: Init TFLint
run: tflint --init
env:
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
GITHUB_TOKEN: ${{ github.token }}

- name: Run TFLint
run: tflint -f compact --recursive

- uses: terraform-linters/setup-tflint@v4
with:
tflint_wrapper: true

- id: tflint
run: tflint -f compact --recursive

- run: echo ${{ steps.tflint.outputs.stdout }}
- run: echo ${{ steps.tflint.outputs.stderr }}
- run: echo ${{ steps.tflint.outputs.exitcode }}

29 changes: 29 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Trivy Security Scanner
on:
push:
branches: [ main, develop, workflow_dispatch ]
pull_request:

jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3


- name: Aqua Security Trivy
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scanners: 'misconfig,secret'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'

0 comments on commit 18c6ace

Please sign in to comment.