Skip to content

Commit 2238e21

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

5 files changed

Lines changed: 28 additions & 29 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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: 'Setup Project'
22
description: 'Centralized setup for CI jobs'
33
inputs:
4+
branch:
5+
description: 'Branch/ref to publish from'
6+
required: false
7+
default: 'main'
48
fetch-depth:
59
description: 'Git fetch depth'
610
required: false
@@ -23,6 +27,7 @@ runs:
2327
with:
2428
fetch-depth: ${{ inputs.fetch-depth }}
2529
token: ${{ inputs.token }}
30+
ref: ${{ inputs.branch }}
2631

2732
- uses: pnpm/action-setup@v4
2833
with:

.github/workflows/ci-fork.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
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:
24+
# head commit is fine; the default merge ref also works on pull_request
1525
ref: ${{ github.event.pull_request.head.sha }}
1626
fetch-depth: 0
1727

@@ -20,26 +30,28 @@ jobs:
2030
run_install: false
2131

2232
- uses: actions/setup-node@v4
23-
id: cache
2433
with:
2534
node-version-file: '.node-version'
2635
cache: 'pnpm'
36+
cache-dependency-path: '**/pnpm-lock.yaml'
2737

2838
- run: pnpm install --frozen-lockfile
2939

30-
- name: Cache Playwright browsers
31-
uses: actions/cache@v4
40+
# Restore-only cache to avoid save attempts/noise on forks
41+
- name: Restore Playwright browsers cache
42+
uses: actions/cache/restore@v4
3243
with:
3344
path: ~/.cache/ms-playwright
3445
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
3546
restore-keys: |
3647
${{ runner.os }}-playwright-
3748
38-
- run: pnpm exec playwright install
49+
- run: pnpm exec playwright install --with-deps
3950

4051
- 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
52+
53+
# Needed so nx affected can diff against main
54+
- run: git branch --track main origin/main || true
4355

4456
- run: pnpm nx format:check
4557
- 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: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ jobs:
4949
fetch-depth: 0
5050
token: ${{ secrets.GH_TOKEN }}
5151

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-
6052
- name: publish
6153
uses: changesets/action@v1
6254
id: changesets
@@ -81,14 +73,6 @@ jobs:
8173
- name: Publish Beta Steps
8274
if: steps.changesets.outputs.published == 'false'
8375
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'
9276

9377
- name: Calculate baseline bundle sizes
9478
run: |

0 commit comments

Comments
 (0)