Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Claude Code Review

on:
pull_request:
types: [opened, synchronize, labeled]
pull_request_target:
types: [opened, synchronize]
# Optional: Only run on specific file changes
# paths:
# - "src/**/*.ts"
Expand All @@ -13,14 +13,12 @@ on:
jobs:
claude-review:
# Skip review for automated "Version Packages" PRs created by changesets
# For external PRs: requires 'ci' label
# For internal PRs: runs automatically
if: |
github.event.pull_request.title != 'Version Packages' &&
(github.event.pull_request.head.repo.full_name == github.repository ||
contains(github.event.pull_request.labels.*.name, 'ci'))
# For external PRs: requires manual approval via 'external-pr' environment
# For internal PRs: runs automatically without approval
if: github.event.pull_request.title != 'Version Packages'

runs-on: ubuntu-latest
environment: ${{ github.event.pull_request.head.repo.full_name != github.repository && 'external-pr' || null }}
permissions:
contents: read
pull-requests: read
Expand All @@ -31,6 +29,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1

- name: Run Claude Code Review
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/pkg-pr-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,26 @@ permissions:
pull-requests: write # Required for pkg.pr.new to comment on PRs

on:
pull_request:
types: [opened, synchronize, reopened, labeled]
pull_request_target:
types: [opened, synchronize, reopened]
paths:
- '**'
- '!**/*.md'
- '!.changeset/**'

jobs:
publish-preview:
# For external PRs: requires 'ci' label
# For internal PRs: runs automatically
if: |
github.event.pull_request.head.repo.full_name == github.repository ||
contains(github.event.pull_request.labels.*.name, 'ci')
# For external PRs: requires manual approval via 'external-pr' environment
# For internal PRs: runs automatically without approval
runs-on: ubuntu-latest
timeout-minutes: 15
environment: ${{ github.event.pull_request.head.repo.full_name != github.repository && 'external-pr' || null }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Setup Node.js
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
contents: read

on:
pull_request:
types: [opened, synchronize, reopened, labeled]
pull_request_target:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -20,6 +20,8 @@
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- uses: actions/setup-node@v4
with:
Expand All @@ -30,13 +32,13 @@
with:
bun-version: latest

- name: Install dependencies
run: npm ci

- name: Build packages

Check failure

Code scanning / CodeQL

Cache Poisoning via execution of untrusted code High

Potential cache poisoning in the context of the default branch due to privilege checkout of untrusted code. (
pull_request_target
).
run: npm run build

- name: Get package version

Check failure

Code scanning / CodeQL

Cache Poisoning via execution of untrusted code High

Potential cache poisoning in the context of the default branch due to privilege checkout of untrusted code. (
pull_request_target
).
id: get-version
run: |
VERSION=$(node -p "require('./packages/sandbox/package.json').version")
Expand Down Expand Up @@ -68,21 +70,21 @@
path: sandbox_test.log
retention-days: 7

- name: Run container unit tests
run: npm run test -w @repo/sandbox-container

# E2E tests against deployed worker
# For external PRs: requires 'ci' label
# For internal PRs: runs automatically
# For external PRs: requires manual approval via 'external-pr' environment
# For internal PRs: runs automatically without approval
e2e-tests:

Check failure

Code scanning / CodeQL

Cache Poisoning via execution of untrusted code High

Potential cache poisoning in the context of the default branch due to privilege checkout of untrusted code. (
pull_request_target
).
needs: unit-tests
if: |
github.event.pull_request.head.repo.full_name == github.repository ||
contains(github.event.pull_request.labels.*.name, 'ci')
timeout-minutes: 30
runs-on: ubuntu-latest
environment: ${{ github.event.pull_request.head.repo.full_name != github.repository && 'external-pr' || null }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- uses: actions/setup-node@v4
with:
Expand All @@ -103,7 +105,7 @@
- name: Set environment name
id: env-name
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
echo "env_name=pr-${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
echo "worker_name=sandbox-e2e-test-worker-pr-${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
else
Expand Down Expand Up @@ -161,7 +163,7 @@

# Cleanup: Delete test worker and container (only for PR environments)
- name: Cleanup test deployment
if: always() && github.event_name == 'pull_request'
if: always() && github.event_name == 'pull_request_target'
continue-on-error: true
run: |
cd tests/e2e/test-worker
Expand Down