fix(ci): run on all PRs with conditional skip (#344)

- Remove paths filter from pull_request trigger
- Add check-changes job to detect code changes
- Skip full CI if no code files changed
- Satisfies branch protection while avoiding unnecessary builds
This commit is contained in:
YHH
2025-12-26 17:15:02 +08:00
committed by GitHub
parent da5bf2116a
commit 9327c1cef5

View File

@@ -13,18 +13,31 @@ on:
- '.github/workflows/ci.yml'
pull_request:
branches: [ master, main, develop ]
paths:
# Run on all PRs to satisfy branch protection, but skip build if no code changes
jobs:
# Check if we need to run the full CI
check-changes:
runs-on: ubuntu-latest
outputs:
should-run: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
code:
- 'packages/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'tsconfig.json'
- 'turbo.json'
- 'jest.config.*'
- '.github/workflows/ci.yml'
- '.changeset/**'
jobs:
ci:
needs: check-changes
if: needs.check-changes.outputs.should-run == 'true'
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}