Merge release 3.1.0 #592
Workflow file for this run
This file contains hidden or 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
| name: "SpotBugs" | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| # The branches below must be a subset of the branches above | |
| branches: [ main ] | |
| schedule: | |
| - cron: "25 16 * * 0" | |
| permissions: read-all | |
| jobs: | |
| analyze: | |
| name: SpotBugs Analyze | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| language: [ "java" ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Java | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| distribution: "temurin" | |
| java-version: "17" | |
| - name: Build with Gradle | |
| run: ./gradlew spotbugsSarif | |
| - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: sarif-files | |
| path: ./build/spotbugs/*.sarif | |
| retention-days: 1 | |
| upload: | |
| name: Upload SARIF | |
| needs: analyze | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| module: | |
| [ | |
| "android", | |
| "core", | |
| "desktop", | |
| "fido", | |
| "fido-android-ui", | |
| "management", | |
| "oath", | |
| "openpgp", | |
| "piv", | |
| "support", | |
| "testing", | |
| "yubiotp", | |
| ] | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: sarif-files | |
| - run: | | |
| MODULE=${{ matrix.module }} | |
| BASE_NAME=spotbugs-${MODULE} | |
| INPUT=${BASE_NAME}.sarif | |
| OUTPUT=${BASE_NAME}.json | |
| jq '.runs |= map( if .taxonomies == [null] then .taxonomies = [] else . end)' < ${INPUT} | | |
| jq ".runs[].results[].locations[].physicalLocation.artifactLocation.uri |= \"${MODULE}/src/main/java/\" + ." | | |
| jq ".runs[].results[].locations[].physicalLocation.artifactLocation.uriBaseId |= \"%SRC_ROOT%\" " | | |
| jq '.runs[].tool.driver.rules |= map( . += { fullDescription: { text: .shortDescription.text } } )' | | |
| jq '.runs[].tool.driver.rules |= map( . += { name: ("SpotBugs_" + .id | ascii_downcase | sub("(^|_)(?<x>[a-z])";"\(.x|ascii_upcase)";"g")) } )' | | |
| jq '.runs[].tool.driver.rules |= map( . += { help: { text: .helpUri } } )' | | |
| jq '.runs[].invocations |= map( . += { executionSuccessful: true } )' | | |
| jq 'del(.runs[].originalUriBaseIds)' | | |
| jq -c '.' > ${OUTPUT} | |
| - name: Upload SARIF for ${{ matrix.module }} | |
| uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 | |
| with: | |
| sarif_file: spotbugs-${{ matrix.module }}.json | |
| category: spotbugs-analysis-${{ matrix.module }} |