Skip to content

Commit 0c371ea

Browse files
authored
Merge pull request #264 from oracle/stop-dependabot-failure
Don't run Sonar checks when SONAR_TOKEN not set, such as for dependabot
2 parents 46adabc + 706b8ea commit 0c371ea

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
distribution: 'temurin'
2020
java-version: 17
2121
- name: Cache SonarCloud packages
22-
uses: actions/cache@v1
22+
uses: actions/cache@v3
2323
with:
2424
path: ~/.sonar/cache
2525
key: ${{ runner.os }}-sonar
2626
restore-keys: ${{ runner.os }}-sonar
2727
- name: Cache Maven packages
28-
uses: actions/cache@v1
28+
uses: actions/cache@v3
2929
with:
3030
path: ~/.m2
3131
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
@@ -34,4 +34,8 @@ jobs:
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.ECNJ_GITHUB_TOKEN }} # Needed to get PR information, if any
3636
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37-
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=oracle_weblogic-monitoring-exporter
37+
run: |
38+
mvn clean install
39+
if [ ! -z "${SONAR_TOKEN}" ]; then
40+
mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=oracle_weblogic-monitoring-exporter
41+
fi

0 commit comments

Comments
 (0)