Skip to content

Commit a827455

Browse files
committed
resilient against empty sarif files
1 parent 97fc839 commit a827455

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/code_quality.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,32 @@ jobs:
4343
with:
4444
fetch-depth: 0
4545
ref: ${{ github.event.pull_request.head.sha }}
46-
# - run: "git diff --name-only origin/main"
46+
4747
- uses: actions/setup-java@v4
4848
with:
4949
distribution: 'corretto'
5050
java-version: '21'
5151
cache: 'gradle'
52+
5253
- name: Build with Gradle
5354
run: ./gradlew --parallel --continue checkstyleMainChanged
55+
5456
- name: "Touch files to avoid errors"
55-
run: "mkdir -p build/reports/checkstyle/ && touch build/reports/checkstyle/main_diff.{md,sarif.json}"
57+
run: |
58+
mkdir -p build/reports/checkstyle/
59+
touch build/reports/checkstyle/main_diff.md
60+
echo '{ "$schema": "https://json.schemastore.org/sarif-2.1.0.json", "version": "2.1.0", "runs": []}' > build/reports/checkstyle/main_diff.mdsarif.json
61+
5662
- name: "Job summary"
5763
run: "cat build/reports/checkstyle/main_diff.md >> $GITHUB_STEP_SUMMARY"
64+
5865
- name: Upload checkstyle report
5966
uses: actions/upload-artifact@v4
6067
if: (success() || failure())
6168
with:
6269
name: checkstyle-report
6370
path: build/reports/checkstyle/main_diff.html
71+
6472
- name: "Publish in Github code scanning"
6573
uses: github/codeql-action/upload-sarif@v3
6674
if: (success() || failure())

0 commit comments

Comments
 (0)