From 4dc91e5c152ee183b63f91428cedbe8bf4c58958 Mon Sep 17 00:00:00 2001 From: Ivan Gonzalez Date: Thu, 15 Feb 2024 15:27:20 -0500 Subject: [PATCH 1/4] ci: adding head ref metadata to PR config --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 58e5ee0..777f887 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.ref }} + ref: ${{ github.head_ref }} - name: Initialize CodeQL From d73bb3b49e29f5bf94ec668ad1e6fecb9e815e18 Mon Sep 17 00:00:00 2001 From: Ivan Gonzalez Date: Fri, 16 Feb 2024 21:08:42 -0500 Subject: [PATCH 2/4] ci: adding pull_request_target to if --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 777f887..bf7c708 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -12,7 +12,7 @@ permissions: jobs: analyze_on_PR: name: Analyze on PR - if: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request' }} + if: ${{ github.actor != 'dependabot[bot]' && ( github.event_name == 'pull_request' || github.event_name == 'pull_request_target' )}} runs-on: ubuntu-latest strategy: fail-fast: false @@ -41,7 +41,7 @@ jobs: analyze_on_branch: name: Analyze on branch - if: ${{ github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' }} + if: ${{ github.actor != 'dependabot[bot]' && ( github.event_name != 'pull_request' || github.event_name != 'pull_request_target' ) }} runs-on: ubuntu-latest strategy: fail-fast: false From bb981bf501135b77245a4153ff36e90e6796409f Mon Sep 17 00:00:00 2001 From: Ivan Gonzalez Date: Fri, 16 Feb 2024 21:10:55 -0500 Subject: [PATCH 3/4] ci: trying to fix analyze on branch --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bf7c708..5928467 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -41,7 +41,7 @@ jobs: analyze_on_branch: name: Analyze on branch - if: ${{ github.actor != 'dependabot[bot]' && ( github.event_name != 'pull_request' || github.event_name != 'pull_request_target' ) }} + if: ${{ github.actor != 'dependabot[bot]' && ( github.event_name != 'pull_request' && github.event_name != 'pull_request_target' ) }} runs-on: ubuntu-latest strategy: fail-fast: false From e1181a06eb9a8574a6a72d4ea0ccb7200e7d38b6 Mon Sep 17 00:00:00 2001 From: Ivan Gonzalez Date: Fri, 16 Feb 2024 21:15:47 -0500 Subject: [PATCH 4/4] ci: logging event name --- .github/workflows/codeql.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5928467..f103dcb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -55,6 +55,10 @@ jobs: fetch-depth: 0 ref: ${{ github.ref }} + - name: test event name + run: | + echo ${{ github.event_name }} + - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: