Skip to content

Commit 90fe52e

Browse files
ci: only run workflow when necessary (#54)
1 parent ace2d97 commit 90fe52e

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
name: CI/CD Pipeline
22

33
on:
4-
push:
5-
branches: [main]
6-
paths-ignore:
7-
- "docs/**"
8-
- "**.md"
9-
- ".github/ISSUE_TEMPLATE/**"
10-
- ".claude/**"
114
pull_request:
125
branches: [main]
136
paths-ignore:
@@ -24,6 +17,7 @@ concurrency:
2417

2518
jobs:
2619
build-and-test:
20+
if: github.event_name == 'pull_request'
2721
runs-on: ubuntu-latest
2822
permissions:
2923
contents: read
@@ -36,22 +30,15 @@ jobs:
3630
with:
3731
dotnet-version: 9.x
3832

39-
- name: Restore dependencies
40-
run: dotnet restore
41-
4233
- name: Check formatting
4334
run: |
4435
dotnet tool restore
4536
dotnet csharpier check .
4637
47-
- name: Build
48-
run: dotnet build --no-restore --configuration Release
49-
5038
- name: Test
51-
run: dotnet test --no-build --configuration Release --verbosity normal
39+
run: dotnet test --configuration Release --verbosity normal
5240

5341
publish:
54-
needs: build-and-test
5542
if: github.event_name == 'release'
5643
runs-on: ubuntu-latest
5744
permissions:
@@ -72,7 +59,6 @@ jobs:
7259
- name: Build and Pack
7360
run: |
7461
VERSION="${{ github.event.release.tag_name }}"
75-
# Remove v prefix if present
7662
[[ "$VERSION" =~ ^v ]] && VERSION="${VERSION:1}"
7763
dotnet pack JsonApiToolkit/JsonApiToolkit.csproj -p:PackageVersion=$VERSION -c Release
7864

0 commit comments

Comments
 (0)