Skip to content

Commit ca20c95

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

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/compile-queries.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ 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-
id: merge-base
21+
if: ${{ github.event_name == 'pull_request' }}
2222
env:
2323
BASE_BRANCH: ${{ github.base_ref }}
2424
run: |
2525
MERGE_BASE=$(git merge-base --fork-point origin/$BASE_BRANCH)
2626
echo "merge-base=$MERGE_BASE" >> $GITHUB_ENV
27+
- name: Calculate merge-base - main
28+
if: ${{ github.event_name != 'pull_request' }}
29+
# using github.sha instead, since we're on main
30+
run: |
31+
MERGE_BASE=${{ github.sha }})
32+
echo "merge-base=$MERGE_BASE" >> $GITHUB_ENV
2733
- name: Cache CodeQL query compilation
2834
uses: actions/cache@v3
2935
with:

0 commit comments

Comments
 (0)