diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 33f6c585..74df9802 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,13 +28,13 @@ jobs: android: ${{ steps.decide.outputs.android }} steps: - name: Checkout - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' || github.event_name == 'push' uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: fetch-depth: 0 - - name: Filter PR paths - if: github.event_name == 'pull_request' + - name: Filter changed paths + if: github.event_name == 'pull_request' || github.event_name == 'push' uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 id: filter with: @@ -49,22 +49,21 @@ jobs: - '*.mjs' - 'package.json' - 'package-lock.json' - actions: - - '.github/workflows/**' - - '.github/actions/**' + - '.github/workflows/codeql.yml' android: - 'mobile/**' - name: Decide CodeQL targets id: decide run: | - if [ "${{ github.event_name }}" != "pull_request" ]; then + # Always run CodeQL Actions (~25s) so every PR/push uploads SARIF for OSSF Scorecard SAST=10, + # while gating heavier JS/TS and Android scans to matching path changes on PRs and pushes. + echo "actions=true" >> "$GITHUB_OUTPUT" + if [ "${{ github.event_name }}" != "pull_request" ] && [ "${{ github.event_name }}" != "push" ]; then echo "js=true" >> "$GITHUB_OUTPUT" - echo "actions=true" >> "$GITHUB_OUTPUT" echo "android=true" >> "$GITHUB_OUTPUT" else echo "js=${{ steps.filter.outputs.js }}" >> "$GITHUB_OUTPUT" - echo "actions=${{ steps.filter.outputs.actions }}" >> "$GITHUB_OUTPUT" echo "android=${{ steps.filter.outputs.android }}" >> "$GITHUB_OUTPUT" fi