Skip to content

Commit 9bf7370

Browse files
committed
chore: add ci workflow for forks
1 parent df6ac87 commit 9bf7370

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.github/workflows/ci-fork.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: ForgeRock Fork Pull Request CI
2+
3+
on:
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
13+
14+
jobs:
15+
pr:
16+
# Only run for forks
17+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 20
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
# head commit is fine; the default merge ref also works on pull_request
25+
ref: ${{ github.event.pull_request.head.sha }}
26+
fetch-depth: 0
27+
28+
- uses: pnpm/action-setup@v4
29+
with:
30+
run_install: false
31+
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version-file: '.node-version'
35+
cache: 'pnpm'
36+
cache-dependency-path: '**/pnpm-lock.yaml'
37+
38+
- run: pnpm install --frozen-lockfile
39+
40+
# Restore-only cache to avoid save attempts/noise on forks
41+
- name: Restore Playwright browsers cache
42+
uses: actions/cache/restore@v4
43+
with:
44+
path: ~/.cache/ms-playwright
45+
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
46+
restore-keys: |
47+
${{ runner.os }}-playwright-
48+
49+
- run: pnpm exec playwright install --with-deps
50+
51+
- uses: nrwl/nx-set-shas@v4
52+
53+
# Needed so nx affected can diff against main
54+
- run: git branch --track main origin/main || true
55+
56+
- run: pnpm nx format:check
57+
- run: pnpm nx affected -t build typecheck lint test e2e-ci

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77
NX_CLOUD_DISTRIBUTED_EXECUTION: true
88
jobs:
99
pr:
10+
if: ${{github.event.pull_request.head.repo.full_name == github.repository}}
1011
runs-on: ubuntu-latest
1112
steps:
1213
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)