From 90559a78f8b47db4cdeedc78827eec22fbc6e2e2 Mon Sep 17 00:00:00 2001 From: LiusCraft Date: Fri, 12 Sep 2025 11:53:59 +0800 Subject: [PATCH] Fix PR deployment workflow to use correct ref and event - Use pull_request.head.sha to checkout the actual PR code - Change trigger from pull_request to pull_request_target for proper permissions --- .github/workflows/deploy-frontend.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-frontend.yml b/.github/workflows/deploy-frontend.yml index 0844fd7..4f9021a 100644 --- a/.github/workflows/deploy-frontend.yml +++ b/.github/workflows/deploy-frontend.yml @@ -15,6 +15,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node.js uses: actions/setup-node@v4 @@ -44,7 +46,7 @@ jobs: scope: ${{ secrets.VERCEL_ORG_ID }} - name: Comment PR - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request_target' uses: actions/github-script@v7 with: script: |