-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build, Publish script update, added git hook for code formatting. (#25)
* `snyk.yml` workflow, which serves the purpose of identifying and addressing dependency vulnerabilities in the project. * `sonar.yml` workflow to analyze the source code, enhancing code quality and maintainability. * `git-build-hook-maven-plugin` plugin into the project, providing support for Git hooks. * `pre-commit.sh` hook, which automatically executes `mvn spotless:apply` prior to each commit, ensuring code formatting consistency. ### Changed * Bumped `jackson` version to `2.17.0` * Bumped `slf4j-api` version to `2.0.16` * Bumped `junit-jupiter` version to `5.11.0` * Bumped `guava` version to `33.3.0-jre` * Bumped `maven-gpg-plugin` version to `3.2.5` * Bumped `spotless-maven-plugin` version to `2.43.0`
- Loading branch information
1 parent
9f51c63
commit 41c41d9
Showing
10 changed files
with
207 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Snyk vulnerability scan | ||
|
||
on: [push] | ||
|
||
jobs: | ||
snyk: | ||
name: Run Snyk to check for vulnerabilities | ||
permissions: | ||
security-events: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Snyk vulnerability check | ||
uses: snyk/actions/maven-3-jdk-11@master | ||
continue-on-error: true | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
args: --sarif-file-output=snyk.sarif | ||
--severity-threshold=high | ||
- name: Upload Results to GitHub Code Scanning | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: snyk.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: SonarCloud analysis | ||
|
||
on: [push] | ||
|
||
jobs: | ||
sonarcloud: | ||
name: SonarCloud analysis | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Sonarcloud code analysis | ||
run: | | ||
mvn -B verify sonar:sonar \ | ||
-Dsonar.host.url=https://sonarcloud.io \ | ||
-Dsonar.organization=infobip \ | ||
-Dsonar.projectKey=infobip_infobip-api-java-client \ | ||
-Dsonar.login=${{ secrets.SONAR_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*.class | ||
.idea/ | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
# Part 1 | ||
stagedFiles=$(git diff --staged --name-only) | ||
# Part 2 | ||
echo "Running spotlessApply. Formatting code..." | ||
mvn spotless:apply | ||
# Part 3 | ||
for file in $stagedFiles; do | ||
if test -f "$file"; then | ||
git add $file | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters