Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@ on:
jobs:
snyk:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Mask username
run: echo "::add-mask::${{ secrets.STATIC_CODE_ANALYSIS_USERNAME }}"
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/maven-3-jdk-21@master
continue-on-error: true # To make sure that SARIF upload gets called
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=medium --all-projects
args: --sarif-file-output=snyk.sarif --severity-threshold=medium --all-projects
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: snyk.sarif
35 changes: 35 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: SonarQube Scan

on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
branch:
description: 'Branch to scan'
required: true
default: 'main'

jobs:
sonar:
name: SonarQube Scan
runs-on: ubuntu-latest
steps:
- name: Mask username
run: echo "::add-mask::${{ secrets.STATIC_CODE_ANALYSIS_USERNAME }}"
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: maven
- name: SonarQube code scan
run: |
mvn -B verify sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=infobip \
-Dsonar.projectKey=infobip-openapi-mcp \
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco-aggregate/jacoco.xml \
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
27 changes: 27 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,33 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.14</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down