Skip to content

Commit bfe0ff9

Browse files
committed
chore: update-fork-flow
1 parent fbf3a49 commit bfe0ff9

5 files changed

Lines changed: 33 additions & 41 deletions

File tree

.github/actions/publish-beta/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: 'Publish Beta Steps'
22
description: 'Steps to run when packages are not published (beta branch)'
3-
inputs:
43

54
runs:
65
using: 'composite'

.github/actions/setup/action.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
name: 'Setup Project'
22
description: 'Centralized setup for CI jobs'
33
inputs:
4-
fetch-depth:
5-
description: 'Git fetch depth'
6-
required: false
7-
default: '0'
8-
token:
9-
description: 'GitHub token'
10-
required: true
114
node-version-file:
125
description: 'Node version file'
136
required: false
@@ -19,11 +12,6 @@ inputs:
1912
runs:
2013
using: 'composite'
2114
steps:
22-
- uses: actions/checkout@v4
23-
with:
24-
fetch-depth: ${{ inputs.fetch-depth }}
25-
token: ${{ inputs.token }}
26-
2715
- uses: pnpm/action-setup@v4
2816
with:
2917
run_install: false

.github/workflows/ci-fork.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
name: ForgeRock Fork Pull Request CI
2+
23
on:
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

814
jobs:
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

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ concurrency:
1616

1717
jobs:
1818
pr:
19+
if: ${{github.event.pull_request.head.repo.full_name == github.repository}}
1920
runs-on: ubuntu-latest
2021
timeout-minutes: 20
2122
permissions:
@@ -37,8 +38,6 @@ jobs:
3738

3839
- run: pnpm install --frozen-lockfile
3940

40-
# This line enables distribution
41-
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
4241
- run: pnpm dlx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yml" --stop-agents-after="e2e-ci" --with-env-vars="CODECOV_TOKEN"
4342
- run: pnpm nx sync:check
4443

.github/workflows/publish.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,17 @@ jobs:
4343
id-token: write
4444
runs-on: ubuntu-latest
4545
steps:
46+
- uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
token: ${{ github.token }}
50+
4651
- name: Setup Project
4752
uses: ./.github/actions/setup
4853
with:
4954
fetch-depth: 0
5055
token: ${{ secrets.GH_TOKEN }}
5156

52-
- uses: actions/setup-node@v5
53-
id: cache
54-
with:
55-
node-version-file: '.node-version'
56-
pnpm-cache-folder: .pnpm-store
57-
env:
58-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
59-
6057
- name: publish
6158
uses: changesets/action@v1
6259
id: changesets
@@ -81,14 +78,6 @@ jobs:
8178
- name: Publish Beta Steps
8279
if: steps.changesets.outputs.published == 'false'
8380
uses: ./.github/actions/publish-beta
84-
with:
85-
branch: main
86-
87-
- uses: JamesIves/github-pages-deploy-action@v4.7.3
88-
with:
89-
folder: docs
90-
commit-message: 'chore: release-api-docs-beta'
91-
target-folder: 'beta'
9281

9382
- name: Calculate baseline bundle sizes
9483
run: |
@@ -118,6 +107,12 @@ jobs:
118107
env:
119108
HUSKY: 0
120109
steps:
110+
- uses: actions/checkout@v4
111+
with:
112+
fetch-depth: 0
113+
token: ${{ github.token }}
114+
ref: ${{ inputs.branch }}
115+
121116
- name: Setup Project
122117
uses: ./.github/actions/setup
123118
with:

0 commit comments

Comments
 (0)