From 27f7127ccdac125e97e4c35850846bb1160f7131 Mon Sep 17 00:00:00 2001 From: Shlee Date: Sat, 29 Aug 2026 22:08:01 +0930 Subject: [PATCH] Update php-psalm.yml --- .github/workflows/php-psalm.yml | 54 +++++++++++++++++---------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/.github/workflows/php-psalm.yml b/.github/workflows/php-psalm.yml index d430d7300..bbca68a58 100644 --- a/.github/workflows/php-psalm.yml +++ b/.github/workflows/php-psalm.yml @@ -1,10 +1,12 @@ name: PHP - Psalm -on: - push: - branches: [staging, dev, unstable] - pull_request: - branches: [staging, dev, unstable] +# Disabled for now.. too many errors +on: [] +# on: +# push: +# branches: [staging, dev, unstable] +# pull_request: +# branches: [staging, dev, unstable] permissions: contents: read @@ -54,25 +56,25 @@ jobs: - name: Run Psalm (type analysis, report only) run: vendor/bin/psalm --output-format=github --report=psalm.sarif.json || true - # # Psalm only writes the SARIF file when it runs far enough to produce a report. - # # If it crashed early (e.g. bad config), skip the upload rather than pushing a - # # blank SARIF, which would clear existing Code Scanning alerts. - # - name: Check for SARIF report - # id: sarif - # if: ${{ !cancelled() }} - # run: | - # if [ -f psalm.sarif.json ]; then - # echo "exists=true" >> "$GITHUB_OUTPUT" - # else - # echo "exists=false" >> "$GITHUB_OUTPUT" - # echo "::warning::Psalm did not produce psalm.sarif.json; skipping Code Scanning upload." - # fi + # Psalm only writes the SARIF file when it runs far enough to produce a report. + # If it crashed early (e.g. bad config), skip the upload rather than pushing a + # blank SARIF, which would clear existing Code Scanning alerts. + - name: Check for SARIF report + id: sarif + if: ${{ !cancelled() }} + run: | + if [ -f psalm.sarif.json ]; then + echo "exists=true" >> "$GITHUB_OUTPUT" + else + echo "exists=false" >> "$GITHUB_OUTPUT" + echo "::warning::Psalm did not produce psalm.sarif.json; skipping Code Scanning upload." + fi - # # Surface findings as Code Scanning alerts on the PR (Security tab). Runs even - # # when the Psalm step failed, but only when a real SARIF file was produced. - # - name: Upload SARIF to Code Scanning - # if: ${{ !cancelled() && steps.sarif.outputs.exists == 'true' }} - # uses: github/codeql-action/upload-sarif@v4 - # with: - # sarif_file: psalm.sarif.json - # category: psalm + # Surface findings as Code Scanning alerts on the PR (Security tab). Runs even + # when the Psalm step failed, but only when a real SARIF file was produced. + - name: Upload SARIF to Code Scanning + if: ${{ !cancelled() && steps.sarif.outputs.exists == 'true' }} + uses: github/codeql-action/upload-sarif@v4 + with: + sarif_file: psalm.sarif.json + category: psalm