From 5822a13f6a82adff522cbf7cfe70b644db82b012 Mon Sep 17 00:00:00 2001 From: Terada Kousuke Date: Sun, 5 Apr 2026 16:55:14 +0900 Subject: [PATCH] fix(ci): use pull_request_target for fork runner compatibility GitHub-hosted runners are not allocated for pull_request events on forked repos. Switch to pull_request_target which runs in the base repo context. Explicitly checkout PR head SHA to test the correct code. Closes #62 Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/test.yml | 4 +++- .github/workflows/typecheck.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ca315d99874..56378328e57e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: push: branches: - dev - pull_request: + pull_request_target: workflow_dispatch: concurrency: @@ -25,6 +25,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Bun @@ -76,6 +77,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Bun diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index b247d24b40db..06ca95b1f463 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -3,7 +3,7 @@ name: typecheck on: push: branches: [dev] - pull_request: + pull_request_target: branches: [dev] workflow_dispatch: @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Setup Bun uses: ./.github/actions/setup-bun