Skip to content

Commit e00d780

Browse files
committed
Apply feedback
1 parent 23eee4f commit e00d780

File tree

1 file changed

+41
-16
lines changed

1 file changed

+41
-16
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,49 @@ on:
1515
- ".changeset/**"
1616
pull_request:
1717
types: [opened, synchronize, reopened]
18-
paths:
19-
- .github/workflows/ci.yml
18+
paths-ignore:
19+
- "**.md"
20+
- ".changeset/**"
2021

21-
concurrency: ${{ github.workflow }}--${{ github.ref }}
22+
concurrency:
23+
group: ${{ github.workflow }}--${{ github.ref }}
24+
cancel-in-progress: true
2225

2326
permissions:
2427
contents: read
25-
pull-requests: write
28+
pull-requests: read
2629

2730
jobs:
28-
main:
29-
name: Node.js 20
31+
# Basic validation job - runs for all PRs without secrets
32+
basic-validation:
33+
name: Build and lint
34+
runs-on: ubuntu-latest
35+
if: github.event_name == 'pull_request'
36+
37+
steps:
38+
- name: Checkout sources
39+
uses: actions/checkout@v4
40+
41+
- name: Install Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: 20.x
45+
46+
- name: Install dependencies
47+
run: npm ci --no-fund --no-audit
48+
49+
- name: Build
50+
run: npm run build
51+
52+
- name: Check formatting
53+
run: npm run format:check
54+
55+
- name: Run linters
56+
run: npm run lint
57+
58+
# Integration tests with secrets - requires approval for external PRs
59+
tests:
60+
name: Tests
3061
runs-on: ubuntu-latest
3162
# SECURITY: Use environment protection for external contributors
3263
environment: ${{ github.event.pull_request.head.repo.full_name != github.repository && 'external-testing' || '' }}
@@ -42,31 +73,25 @@ jobs:
4273
- name: Checkout sources
4374
uses: actions/checkout@v4
4475
with:
45-
# SECURITY: For external PRs, only checkout trusted base branch
46-
ref: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.head.sha || github.sha }}
76+
# Environment protection provides security - we can safely checkout PR code
77+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
4778

4879
- name: Decrypt keyfile
4980
run: ./.github/scripts/decrypt_secret.sh
5081
env:
5182
KEYFILE_PASSPHRASE: ${{secrets.KEYFILE_PASSPHRASE}}
5283

5384
- name: Install Node.js
54-
uses: actions/setup-node@v3
85+
uses: actions/setup-node@v4
5586
with:
56-
node-version: 20.19
87+
node-version: 20.x
5788

5889
- name: Install dependencies
5990
run: npm ci --no-fund --no-audit
6091

6192
- name: Build
6293
run: npm run build
6394

64-
- name: Check formatting
65-
run: npm run format:check
66-
67-
- name: Run linters
68-
run: npm run lint
69-
7095
- name: Run tests
7196
run: npm run test
7297
env:

0 commit comments

Comments
 (0)