Skip to content

Commit a6aa580

Browse files
committed
fix: action runner
1 parent 794ce1b commit a6aa580

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313

1414
jobs:
1515
build-and-test:
16+
if: |
17+
(github.event_name != 'pull_request' && !github.event.pull_request.head.repo.fork)
18+
|| (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork
19+
|| startsWith(github.head_ref, 'dependabot/')))
1620
runs-on: ${{ matrix.os }}
1721

1822
strategy:
@@ -31,11 +35,15 @@ jobs:
3135
with:
3236
dotnet-version: 8.0.x
3337

34-
- name: Install GitVersion
38+
- name: Setup GitVersion
3539
uses: gittools/actions/gitversion/setup@v3.1.1
3640
with:
3741
versionSpec: '6.0.x'
3842

43+
- name: Execute GitVersion
44+
id: gitversion
45+
uses: gittools/actions/gitversion/execute@v3.1.1
46+
3947
- name: Cache NuGet packages
4048
uses: actions/cache@v3
4149
with:
@@ -44,23 +52,14 @@ jobs:
4452
restore-keys: |
4553
${{ runner.os }}-nuget-
4654
47-
- name: Determine Version
48-
shell: bash
49-
run: |
50-
dotnet-gitversion /output json > version.json
51-
FULL_SEM_VER=$(jq -r .FullSemVer version.json)
52-
ASSEMBLY_VERSION=$(jq -r .AssemblySemFileVer version.json)
53-
echo "FULL_SEM_VER=$FULL_SEM_VER" >> $GITHUB_ENV
54-
echo "ASSEMBLY_VERSION=$ASSEMBLY_VERSION" >> $GITHUB_ENV
55-
5655
- name: Restore dependencies
5756
run: dotnet restore
5857

5958
- name: Build Solution
6059
run: |
61-
echo "Version: ${{ env.FULL_SEM_VER }}"
62-
echo "Assembly Version: ${{ env.ASSEMBLY_VERSION }}"
60+
echo "Version: ${{ steps.gitversion.outputs.fullSemVer }}"
61+
echo "Assembly Version: ${{ steps.gitversion.outputs.assemblySemFileVer }}"
6362
dotnet build --configuration Debug --no-restore
6463
65-
- name: Run Tests (net8.0)
64+
- name: Run Tests
6665
run: dotnet test --configuration Debug --no-build --verbosity normal

0 commit comments

Comments
 (0)