Skip to content

Commit

Permalink
resilient against empty sarif files
Browse files Browse the repository at this point in the history
  • Loading branch information
wadoon committed Feb 25, 2025
1 parent 97fc839 commit a827455
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,32 @@ jobs:
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
# - run: "git diff --name-only origin/main"

- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
cache: 'gradle'

- name: Build with Gradle
run: ./gradlew --parallel --continue checkstyleMainChanged

- name: "Touch files to avoid errors"
run: "mkdir -p build/reports/checkstyle/ && touch build/reports/checkstyle/main_diff.{md,sarif.json}"
run: |
mkdir -p build/reports/checkstyle/
touch build/reports/checkstyle/main_diff.md
echo '{ "$schema": "https://json.schemastore.org/sarif-2.1.0.json", "version": "2.1.0", "runs": []}' > build/reports/checkstyle/main_diff.mdsarif.json
- name: "Job summary"
run: "cat build/reports/checkstyle/main_diff.md >> $GITHUB_STEP_SUMMARY"

- name: Upload checkstyle report
uses: actions/upload-artifact@v4
if: (success() || failure())
with:
name: checkstyle-report
path: build/reports/checkstyle/main_diff.html

- name: "Publish in Github code scanning"
uses: github/codeql-action/upload-sarif@v3
if: (success() || failure())
Expand Down

0 comments on commit a827455

Please sign in to comment.