From 9d0515efd6e4d0cd0ddea2929e2a5b9dc28f63b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Sep 2025 00:13:10 +0000 Subject: [PATCH 1/3] Initial plan From a3903f3f4bef35650915a90fe1d3fe8414570a93 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Sep 2025 00:19:42 +0000 Subject: [PATCH 2/3] Fix CodeQL SARIF upload error by uploading single ktlint SARIF file Co-authored-by: ivan-magda <8586063+ivan-magda@users.noreply.github.com> --- .github/workflows/ci.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c70514e04..eb7343fb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,11 +75,29 @@ jobs: GITHUB_USER: ${{ github.actor }} GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload SARIF - uses: github/codeql-action/upload-sarif@v3 + - name: Find ktlint SARIF file if: success() || failure() + run: | + # Try to find the main SARIF file first, fallback to any available one + if [ -f "shared/build/reports/ktlint/ktlintCommonMainSourceSetCheck/ktlintCommonMainSourceSetCheck.sarif" ]; then + SARIF_FILE="shared/build/reports/ktlint/ktlintCommonMainSourceSetCheck/ktlintCommonMainSourceSetCheck.sarif" + else + SARIF_FILE=$(find shared/build/reports/ktlint -name "*.sarif" -type f | head -1) + fi + + if [ -n "$SARIF_FILE" ] && [ -f "$SARIF_FILE" ]; then + echo "Found ktlint SARIF file: $SARIF_FILE" + echo "sarif_file=$SARIF_FILE" >> $GITHUB_ENV + else + echo "No ktlint SARIF files found" + echo "sarif_file=" >> $GITHUB_ENV + fi + + - name: Upload ktlint SARIF + uses: github/codeql-action/upload-sarif@v3 + if: success() || failure() && env.sarif_file != '' with: - sarif_file: shared/build/reports/ktlint + sarif_file: ${{ env.sarif_file }} category: ktlint detekt: From 975a91ebbf4d02256e1f6558840de6880f28856f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Sep 2025 00:21:02 +0000 Subject: [PATCH 3/3] Fix conditional logic in ktlint SARIF upload step Co-authored-by: ivan-magda <8586063+ivan-magda@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb7343fb5..3151c6bc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: - name: Upload ktlint SARIF uses: github/codeql-action/upload-sarif@v3 - if: success() || failure() && env.sarif_file != '' + if: (success() || failure()) && env.sarif_file != '' with: sarif_file: ${{ env.sarif_file }} category: ktlint