Skip to content

Commit fbf3a49

Browse files
committed
feat: add fork-safe CI workflow
This adds a new GitHub Actions workflow that runs on pull requests from forks. This workflow is designed to be secure by not using any secrets. It runs linting, building, and testing on the affected projects.
1 parent d6171f5 commit fbf3a49

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/ci-fork.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: ForgeRock Fork Pull Request CI
2+
on:
3+
pull_request_target:
4+
types: [opened, synchronize, reopened]
5+
branches:
6+
- main
7+
8+
jobs:
9+
pr:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 20
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
fetch-depth: 0
17+
18+
- uses: pnpm/action-setup@v4
19+
with:
20+
run_install: false
21+
22+
- uses: actions/setup-node@v4
23+
id: cache
24+
with:
25+
node-version-file: '.node-version'
26+
cache: 'pnpm'
27+
28+
- run: pnpm install --frozen-lockfile
29+
30+
- name: Cache Playwright browsers
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.cache/ms-playwright
34+
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
35+
restore-keys: |
36+
${{ runner.os }}-playwright-
37+
38+
- run: pnpm exec playwright install
39+
40+
- 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
43+
44+
- run: pnpm nx format:check
45+
- run: pnpm nx affected -t build typecheck lint test e2e-ci

0 commit comments

Comments
 (0)