Skip to content

Commit 551adba

Browse files
committed
fix merge-base compilation when running directly on main
1 parent ec87a93 commit 551adba

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/compile-queries.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,20 @@ jobs:
1818
fetch-depth: 0
1919
# calculate the merge-base with main, in a way that works both on PRs and pushes to main.
2020
- name: Calculate merge-base
21+
if: ${{ github.event_name == 'pull_request' }}
2122
id: merge-base
2223
env:
2324
BASE_BRANCH: ${{ github.base_ref }}
2425
run: |
2526
MERGE_BASE=$(git merge-base --fork-point origin/$BASE_BRANCH)
2627
echo "merge-base=$MERGE_BASE" >> $GITHUB_ENV
28+
- name: Calculate merge-base - main
29+
if: ${{ github.event_name != 'pull_request' }}
30+
# using github.sha instead, since we're on main
31+
id: merge-base
32+
run: |
33+
MERGE_BASE=${{ github.sha }})
34+
echo "merge-base=$MERGE_BASE" >> $GITHUB_ENV
2735
- name: Cache CodeQL query compilation
2836
uses: actions/cache@v3
2937
with:

0 commit comments

Comments
 (0)