Skip to content

Commit 26084df

Browse files
committed
Set GIT_REF as an environment variable in tests.yml
An environment variable, GIT_REF, has been configured in the test workflow. Its value is defined based on GitHub event repository's default branch. This has been done to standardize the reference used across different steps of the test job. As a result, the run command for mutation.sh has also been simplified and made more readable.
1 parent b104b0c commit 26084df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/tests.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ jobs:
9494
name: Safety mutation tests
9595
runs-on: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
9696
timeout-minutes: 20
97+
env:
98+
GIT_REF: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.event.before || format('origin/{0}', github.event.repository.default_branch) }}
9799
steps:
98100
- uses: actions/checkout@v4
99101
with:
@@ -103,4 +105,4 @@ jobs:
103105
run: |
104106
source setup.sh
105107
scons -j8
106-
GIT_REF=$${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/master-new') && github.event.before || ('origin/master' || 'origin/master-new') }} cd opendbc/safety/tests && ./mutation.sh
108+
cd opendbc/safety/tests && ./mutation.sh

0 commit comments

Comments
 (0)