mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Fix base sha for lint workflow
The base sha for push events is determined differently than for pr. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
6da4e606d4
commit
3c3c57d673
1 changed files with 8 additions and 2 deletions
|
|
@ -7,6 +7,12 @@ on:
|
|||
jobs:
|
||||
cppcheck:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
BASE_SHA: >-
|
||||
${{
|
||||
github.event_name == 'pull_request' && github.event.pull_request.base.sha ||
|
||||
github.event_name == 'push' && github.event.push.before
|
||||
}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
|
@ -37,7 +43,7 @@ jobs:
|
|||
run: sudo apt-get --assume-yes --no-install-recommends install cppcheck
|
||||
|
||||
- name: Fetch the base branch, so we can use `git diff`
|
||||
run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
|
||||
run: git fetch origin ${{ env.BASE_SHA }}
|
||||
|
||||
- name: Check for issues
|
||||
run: ./source/tools/lint/cppcheck/cppcheck.sh --diff ${{ github.event.pull_request.base.ref }}
|
||||
run: ./source/tools/lint/cppcheck/cppcheck.sh --diff ${{ env.BASE_SHA }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue