Skip to content

Commit

Permalink
create and upload sarif
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVe committed Dec 15, 2023
1 parent fdb767d commit c53eb62
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 14 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,3 @@ jobs:
with:
name: maven-repo
path: ~/.m2/repository/com/yubico/yubikit/

- name: Upload build reports
uses: actions/upload-artifact@v3
if: always()
with:
name: build-reports
path: ./*/build/reports/*
39 changes: 39 additions & 0 deletions .github/workflows/spotbugs-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "SpotBugs"

on:
push:
branches: [ adamve/spotbugs-reports-v3 ]
pull_request:
branches: [ adamve/spotbugs-reports-v3 ]
schedule:
- cron: '25 16 * * 0'

jobs:
spotbugs-analyze:
name: SpotBugs Analyze

runs-on: ubuntu-latest

permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Build with Gradle
run: ./gradlew spotbugsRelease spotbugsMain

- name: upload SARIF
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: build/spotbugs/
category: spotbugs-analysis
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ subprojects {
enabled = false
} else {
group 'verification'
reports {
xml.enabled = true
html.enabled = true
reports.create("sarif") {
required = true
outputLocation = file("${project.rootDir}/build/spotbugs/spotbugs-${project.name}.sarif")
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions buildSrc/src/main/groovy/project-convention-spotbugs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ plugins {
}

dependencies {
spotbugs 'com.github.spotbugs:spotbugs:4.8.0'
spotbugs 'com.github.spotbugs:spotbugs:4.8.3'
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'

compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.8.0'
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.8.3'

testImplementation 'com.google.code.findbugs:jsr305:3.0.2'
}
Expand All @@ -22,6 +22,4 @@ spotbugs {

effort = "max"
reportLevel = "low"

reportsDir = project.layout.getBuildDirectory().dir('reports/spotbugs').get().asFile
}

0 comments on commit c53eb62

Please sign in to comment.