Skip to content

Commit 696b2b2

Browse files
committed
ci: disable sonar on dependabot branches in main workflow file
1 parent 5d701d6 commit 696b2b2

File tree

2 files changed

+5
-30
lines changed

2 files changed

+5
-30
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ name: CI
22
on:
33
push:
44
branches-ignore:
5-
- dependabot/**
65
- gh-pages
76
permissions:
87
contents: write
98
pull-requests: write
9+
env:
10+
IS_DEPENDABOT: ${{ startsWith(github.ref_name, 'dependabot/') && 'yes' || '' }}
1011
jobs:
1112
build:
1213
runs-on: ubuntu-latest
@@ -22,17 +23,17 @@ jobs:
2223
- name: Setup Gradle
2324
uses: gradle/actions/setup-gradle@v4
2425
- name: Cache SonarCloud packages
26+
if: ${{ !env.IS_DEPENDABOT }}
2527
uses: actions/cache@v4
2628
with:
2729
path: ~/.sonar/cache
2830
key: ${{ runner.os }}-sonar
2931
restore-keys: ${{ runner.os }}-sonar
3032
- name: Run Gradle checks
3133
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3334
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
34-
run: ./gradlew check sonar --continue
35-
- name: Upload test reports
35+
run: ./gradlew ${{ env.IS_DEPENDABOT && 'check' || 'check sonar' }} --continue --stacktrace
36+
- name: Upload reports
3637
if: ${{ !cancelled() }}
3738
uses: actions/upload-artifact@v4
3839
with:

.github/workflows/dependabot-check.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)