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:
21
.github/workflows/ci.yml
vendored
21
.github/workflows/ci.yml
vendored
@@ -13,18 +13,31 @@ on:
|
|||||||
- '.github/workflows/ci.yml'
|
- '.github/workflows/ci.yml'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master, main, develop ]
|
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/**'
|
- 'packages/**'
|
||||||
- 'package.json'
|
- 'package.json'
|
||||||
- 'pnpm-lock.yaml'
|
- 'pnpm-lock.yaml'
|
||||||
- 'tsconfig.json'
|
- 'tsconfig.json'
|
||||||
- 'turbo.json'
|
- 'turbo.json'
|
||||||
- 'jest.config.*'
|
- 'jest.config.*'
|
||||||
- '.github/workflows/ci.yml'
|
|
||||||
- '.changeset/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ci:
|
ci:
|
||||||
|
needs: check-changes
|
||||||
|
if: needs.check-changes.outputs.should-run == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user