Skip to content

Instantly share code, notes, and snippets.

@hendisantika
Created January 19, 2025 14:57
Show Gist options
  • Save hendisantika/8f484837924c5fe5731832c35609a49b to your computer and use it in GitHub Desktop.
Save hendisantika/8f484837924c5fe5731832c35609a49b to your computer and use it in GitHub Desktop.
Sonar Cloud Template for GitHub Action
name: Sonar Scan
on:
push:
branches:
- sonarqube-setup
jobs:
build-and-analyze:
runs-on: [ ubuntu-latest ]
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '23'
- name: Build Project
run: mvn clean install -DskipTests
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: 'https://sonarcloud.io/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment