Skip to content

Commit

Permalink
fix: Fix maven pr builder (#2516)
Browse files Browse the repository at this point in the history
  • Loading branch information
iluwatar committed May 6, 2023
1 parent 4bea173 commit c0e1603
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/maven-pr-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ on:
branches: [ master ]
types: [ opened, reopened, synchronize ]

permissions:
contents: read

jobs:
build-and-analyze:

Expand Down Expand Up @@ -71,8 +74,10 @@ jobs:
run: sudo apt-get install -y xvfb

- name: Build with Maven and run SonarQube analysis
run: xvfb-run ./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=iluwatar -Dsonar.projectKey=iluwatar_java-design-patterns -Dsonar.pullrequest.branch=${{ github.head_ref }} -Dsonar.pullrequest.base=${{ github.base_ref }} -Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
env:
# Intermediate variable
HEAD_REF: ${{ github.head_ref }}
# These two env variables are needed for sonar analysis
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: xvfb-run ./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=iluwatar -Dsonar.projectKey=iluwatar_java-design-patterns -Dsonar.pullrequest.branch=$HEAD_REF -Dsonar.pullrequest.base=${{ github.base_ref }} -Dsonar.pullrequest.key=${{ github.event.pull_request.number }}

0 comments on commit c0e1603

Please sign in to comment.