-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1.2 KB
/
sonarcloud.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: SonarCloud Analysis
on:
push:
branches:
- main # Run on pushes to the main branch
pull_request:
types: [opened, synchronize, reopened] # Run on pull requests
jobs:
sonarcloud:
name: SonarCloud Scan
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi # Ensure dependencies are installed if requirements.txt exists
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v2 # Updated to latest version
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Ensure this secret is added in your GitHub repository settings
with:
args: >
-Dsonar.organization=macescott # Replace with your SonarCloud organization key
-Dsonar.projectKey=macescott # Replace with your SonarCloud project key
-Dsonar.python.version=3.12 # Ensuring Python version compatibility