Skip to content

Commit b82f05c

Browse files
authored
Merge pull request #32632 from Sidnioulz/sidnioulz/contrib-gh-actions-fork
CI: Provide basic CI jobs for forked repositories, and disable our own jobs
2 parents f2a10d3 + 380f9ac commit b82f05c

File tree

18 files changed

+116
-64
lines changed

18 files changed

+116
-64
lines changed

.github/workflows/cron-weekly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
check-links:
9+
if: github.repository_owner == 'storybookjs'
910
runs-on: ubuntu-latest
1011
steps:
1112
- uses: actions/checkout@v4

.github/workflows/fork-checks.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Fork checks
2+
3+
# This workflow is only for forks, so they can get basic checks in without a CircleCI API key
4+
on:
5+
push:
6+
7+
env:
8+
NODE_OPTIONS: '--max_old_space_size=4096'
9+
10+
jobs:
11+
check:
12+
name: Core Type Checking
13+
if: github.repository_owner != 'storybookjs'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 2
19+
20+
- name: Setup Node.js and Install Dependencies
21+
uses: ./.github/actions/setup-node-and-install
22+
with:
23+
install-code-deps: true
24+
25+
- name: check
26+
run: yarn task --task check
27+
28+
prettier:
29+
name: Core Formatting
30+
if: github.repository_owner != 'storybookjs'
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 2
36+
37+
- name: Setup Node.js and Install Dependencies
38+
uses: ./.github/actions/setup-node-and-install
39+
with:
40+
install-code-deps: true
41+
42+
- name: prettier
43+
run: cd code && yarn lint:prettier --check .
44+
45+
test:
46+
strategy:
47+
matrix:
48+
os: [windows-latest, ubuntu-latest]
49+
runs-on: ${{ matrix.os }}
50+
name: Core Unit Tests, ${{ matrix.os }}
51+
if: github.repository_owner != 'storybookjs'
52+
steps:
53+
- uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 2
56+
57+
- name: Setup Node.js and Install Dependencies
58+
uses: ./.github/actions/setup-node-and-install
59+
with:
60+
install-code-deps: true
61+
62+
- name: compile
63+
run: yarn task --task compile --start-from=compile
64+
65+
- name: Install Playwright Dependencies
66+
run: cd code && yarn exec playwright install chromium --with-deps
67+
68+
- name: test
69+
run: yarn test

.github/workflows/generate-sandboxes.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ defaults:
2424
jobs:
2525
generate-next:
2626
name: Generate to next
27+
if: github.repository_owner == 'storybookjs'
2728
runs-on: ubuntu-latest
2829
steps:
2930
- uses: actions/checkout@v4
@@ -76,6 +77,7 @@ jobs:
7677
7778
generate-main:
7879
name: Generate to main
80+
if: github.repository_owner == 'storybookjs'
7981
runs-on: ubuntu-latest
8082
steps:
8183
- uses: actions/checkout@v4

.github/workflows/handle-release-branches.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55

66
jobs:
77
branch-checks:
8+
if: github.repository_owner == 'storybookjs'
89
runs-on: ubuntu-latest
910
steps:
1011
- id: get-branch
@@ -68,7 +69,7 @@ jobs:
6869
branch: ${{ needs.get-next-release-branch.outputs.branch }}
6970

7071
next-release-branch-check:
71-
if: ${{ always() }}
72+
if: ${{ always() && github.repository_owner == 'storybookjs' }}
7273
needs: [branch-checks, get-next-release-branch]
7374
runs-on: ubuntu-latest
7475
steps:
@@ -87,7 +88,7 @@ jobs:
8788
check: ${{ env.is-next-release-branch }}
8889

8990
request-create-frontpage-branch:
90-
if: ${{ always() }}
91+
if: ${{ always() && github.repository_owner == 'storybookjs' }}
9192
needs:
9293
[branch-checks, next-release-branch-check, create-next-release-branch]
9394
runs-on: ubuntu-latest

.github/workflows/prepare-non-patch-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ concurrency:
3636
jobs:
3737
prepare-non-patch-pull-request:
3838
name: Prepare non-patch pull request
39+
if: github.repository_owner == 'storybookjs'
3940
runs-on: ubuntu-latest
4041
environment: Release
4142
defaults:

.github/workflows/prepare-patch-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ concurrency:
1818
jobs:
1919
prepare-patch-pull-request:
2020
name: Prepare patch pull request
21+
if: github.repository_owner == 'storybookjs'
2122
runs-on: ubuntu-latest
2223
environment: Release
2324
defaults:

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
name: Publish normal version
4040
runs-on: ubuntu-latest
4141
if: |
42+
github.repository_owner == 'storybookjs' &&
4243
github.event_name == 'push' &&
4344
(github.ref_name == 'latest-release' || github.ref_name == 'next-release') &&
4445
contains(github.event.head_commit.message, '[skip ci]') != true
@@ -221,6 +222,7 @@ jobs:
221222
name: Publish canary version
222223
runs-on: ubuntu-latest
223224
if: |
225+
github.repository_owner == 'storybookjs' &&
224226
(
225227
github.event_name == 'workflow_dispatch' ||
226228
(github.event_name == 'pull_request' && endsWith(github.head_ref, 'with-canary-release'))

.github/workflows/stale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
jobs:
77
stale:
88
runs-on: ubuntu-latest
9+
if: github.repository_owner == 'storybookjs'
910
steps:
1011
- uses: actions/stale@v9
1112
with:

.github/workflows/tests-unit.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ on:
88
types: [opened, synchronize, reopened]
99

1010
env:
11-
NODE_OPTIONS: "--max_old_space_size=4096"
11+
NODE_OPTIONS: '--max_old_space_size=4096'
1212

1313
jobs:
1414
build:
1515
name: Core Unit Tests, windows-latest
16+
if: github.repository_owner == 'storybookjs'
1617
runs-on: windows-11-arm
1718
steps:
1819
- uses: actions/checkout@v4

.github/workflows/triage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ permissions:
1515
jobs:
1616
triage:
1717
name: Nissuer
18+
if: github.repository_owner == 'storybookjs'
1819
runs-on: ubuntu-latest
1920
steps:
2021
- uses: balazsorban44/[email protected]

0 commit comments

Comments
 (0)