Skip to content

Commit

Permalink
Simplifies Sona scan
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Dec 30, 2024
1 parent 5874835 commit 838c553
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,8 @@ jobs:
cache: 'maven'
- name: Build with Maven
run: ./mvnw -B -V package -DskipTests=true
- name: Get branch name
id: get-branch-name
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_OUTPUT
else
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
fi
shell: bash
- name: SonarCloud Scan on ${{ steps.get-branch-name.outputs.BRANCH_NAME }}
- name: SonarCloud Scan on ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw -B -V -Pcoverage verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.branch.name=${{ steps.get-branch-name.outputs.BRANCH_NAME }}
run: ./mvnw -B -V -Pcoverage verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

0 comments on commit 838c553

Please sign in to comment.