Skip to content
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
40 changes: 40 additions & 0 deletions .github/workflows/sast-sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: SAST com SonarCloud

on:
push:
branches: [main]
pull_request:

jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v6.0.0
with:
args: >
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT }}
-Dsonar.organization=${{ secrets.SONAR_ORG }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fastapi-backend-template"
version = "2.0.2"
version = "2.0.3"
description = "A FastAPI backend template."
authors = ["ArielMAJ <ariel.maj@hotmail.com>"]
readme = "README.md"
Expand Down Expand Up @@ -44,3 +44,4 @@ omit = [
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

3 changes: 3 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sonar.sources=src
sonar.exclusions=**/*test*.py,**/conftest.py
sonar.python.version=3.12