Skip to content

Commit c0e1603

Browse files
authored
fix: Fix maven pr builder (iluwatar#2516)
1 parent 4bea173 commit c0e1603

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/maven-pr-builder.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ on:
3131
branches: [ master ]
3232
types: [ opened, reopened, synchronize ]
3333

34+
permissions:
35+
contents: read
36+
3437
jobs:
3538
build-and-analyze:
3639

@@ -71,8 +74,10 @@ jobs:
7174
run: sudo apt-get install -y xvfb
7275

7376
- name: Build with Maven and run SonarQube analysis
74-
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 }}
7577
env:
78+
# Intermediate variable
79+
HEAD_REF: ${{ github.head_ref }}
7680
# These two env variables are needed for sonar analysis
7781
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7882
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
83+
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 commit comments

Comments
 (0)