Skip to content

Commit 70e2482

Browse files
Prevent Sonar and Mutation Testing running when triggered by dependabot (#1031)
* Add an if condition to the mutation testing GitHub action to prevent the mutation testing from being run if the GitHub actor is dependabot. * Add a conditional job for the build workflow to not generate a sonar report when triggered by dependabot.
1 parent 161e0b0 commit 70e2482

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/build_workflow.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ jobs:
107107
uses: gradle/actions/setup-gradle@v4
108108

109109
- name: Execute Unit Tests
110-
run: ./gradlew test jacocoTestReport sonar --parallel --build-cache
110+
run: |
111+
if [[ $GITHUB_ACTOR == 'dependabot[bot]' ]]; then
112+
./gradlew test jacocoTestReport --parallel --build-cache
113+
else
114+
./gradlew test jacocoTestReport sonar --parallel --build-cache
115+
fi
111116
working-directory: ./service
112117
env:
113118
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/mutationtesting.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
pitest:
77
# Only run on PRs from the repo. PRs from forks will fail due to lack of permissions and
88
# must use a two stage process
9-
if: github.event.pull_request.head.repo.full_name == github.repository
9+
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout project

0 commit comments

Comments
 (0)