mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-20 23:24:16 +00: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:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user