Skip to content

Instantly share code, notes, and snippets.

@iamcryptoki
Created October 17, 2023 09:37
Show Gist options
  • Save iamcryptoki/514bf2e23d5682841ee273a78cbb7d84 to your computer and use it in GitHub Desktop.
Save iamcryptoki/514bf2e23d5682841ee273a78cbb7d84 to your computer and use it in GitHub Desktop.
SonarQube scans with GitHub Actions
name: SonarQube Scan
on:
pull_request:
branches: ['main']
types: [edited, opened, reopened, synchronize]
jobs:
build:
name: Scan
runs-on: ubuntu-latest
permissions: read-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment