Skip to content

Commit 0141b99

Browse files
committed
fix: run PR checks for changed app paths
1 parent af4f113 commit 0141b99

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

.github/workflows/lint-build-test.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,31 @@ on:
77
- 'backend/**'
88
- 'frontend/**'
99
- '.github/workflows/**'
10+
1011
jobs:
12+
changes:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
frontend: ${{ steps.changed-files.outputs.frontend_any_changed }}
16+
backend: ${{ steps.changed-files.outputs.backend_any_changed }}
17+
workflows: ${{ steps.changed-files.outputs.workflows_any_changed }}
18+
steps:
19+
- uses: actions/checkout@v6
20+
- uses: tj-actions/changed-files@v46
21+
id: changed-files
22+
with:
23+
files_yaml: |
24+
frontend:
25+
- 'frontend/**'
26+
backend:
27+
- 'backend/**'
28+
workflows:
29+
- '.github/workflows/**'
30+
1131
lint-build-frontend:
32+
needs: changes
1233
runs-on: ubuntu-latest
13-
if: ${{ github.event.pull_request.changed_files != '0' && (contains(github.event.pull_request.changed_files, 'frontend/') || contains(github.event.pull_request.changed_files, '.github/workflows/')) }}
34+
if: ${{ needs.changes.outputs.frontend == 'true' || needs.changes.outputs.workflows == 'true' }}
1435
defaults:
1536
run:
1637
working-directory: './frontend'
@@ -25,9 +46,11 @@ jobs:
2546
- run: npm install
2647
- run: npm run lint
2748
- run: npm run build
49+
2850
lint-build-test-backend:
51+
needs: changes
2952
runs-on: ubuntu-latest
30-
if: ${{ github.event.pull_request.changed_files != '0' && (contains(github.event.pull_request.changed_files, 'backend/') || contains(github.event.pull_request.changed_files, '.github/workflows/')) }}
53+
if: ${{ needs.changes.outputs.backend == 'true' || needs.changes.outputs.workflows == 'true' }}
3154
steps:
3255
- uses: actions/checkout@v6
3356
- uses: actions/setup-dotnet@v5

0 commit comments

Comments
 (0)