diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 09b7c2e7..36ad741d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -43,7 +43,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - ref: ${{ github.event.inputs.fastcdr-branch || github.ref || matrix.supported-branches }} + ref: ${{ github.event.inputs.fastcdr-branch || ((github.event_name == 'pull_request') && github.ref) || matrix.supported-branches }} # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL