11name : ForgeRock Fork Pull Request CI
2+
23on :
3- pull_request_target :
4- types : [opened, synchronize, reopened]
5- branches :
6- - main
4+ pull_request :
5+
6+ permissions :
7+ contents : read
8+ actions : read
9+
10+ concurrency :
11+ group : pr-${{ github.event.pull_request.number }}
12+ cancel-in-progress : true
713
814jobs :
915 pr :
16+ # Only run for forks
17+ if : ${{ github.event.pull_request.head.repo.full_name != github.repository }}
1018 runs-on : ubuntu-latest
1119 timeout-minutes : 20
20+
1221 steps :
1322 - uses : actions/checkout@v4
1423 with :
@@ -20,26 +29,28 @@ jobs:
2029 run_install : false
2130
2231 - uses : actions/setup-node@v4
23- id : cache
2432 with :
2533 node-version-file : ' .node-version'
2634 cache : ' pnpm'
35+ cache-dependency-path : ' **/pnpm-lock.yaml'
2736
2837 - run : pnpm install --frozen-lockfile
2938
30- - name : Cache Playwright browsers
31- uses : actions/cache@v4
39+ # Restore-only cache to avoid save attempts/noise on forks
40+ - name : Restore Playwright browsers cache
41+ uses : actions/cache/restore@v4
3242 with :
3343 path : ~/.cache/ms-playwright
3444 key : ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
3545 restore-keys : |
3646 ${{ runner.os }}-playwright-
3747
38- - run : pnpm exec playwright install
48+ - run : pnpm exec playwright install --with-deps
3949
4050 - uses : nrwl/nx-set-shas@v4
41- # This line is needed for nx affected to work when CI is running on a PR
42- - run : git branch --track main origin/main
51+
52+ # Needed so nx affected can diff against main
53+ - run : git branch --track main origin/main || true
4354
4455 - run : pnpm nx format:check
4556 - run : pnpm nx affected -t build typecheck lint test e2e-ci
0 commit comments