Skip to content

Add workflows for Bandit and SonarQube #20

Add workflows for Bandit and SonarQube

Add workflows for Bandit and SonarQube #20

Workflow file for this run

---
name: Bandit and SonarQube
"on":
pull_request: null
push: null
schedule:
- cron: '30 7 * * 3'
workflow_dispatch: null
permissions:
contents: read
security-events: write
actions: read
jobs:
bandit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bandit Scan
uses: shundor/python-bandit-scan@ab1d87dfccc5a0ffab88be3aaac6ffe35c10d6cd # yamllint disable rule:line-length
with:
exit_zero: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
excluded_paths: ./test/
level: MEDIUM
confidence: HIGH
- name: Upload SARIF file to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
category: bandit
sonarcloud:
name: SonarCloud Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v2
with:
args: >
-Dsonar.organization=mxcubeweb
-Dsonar.projectKey=mxcube_mxcubeweb
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}