Saving all local changes before sync #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |