From f7db684f47c026d827bde4ae4567a015d823bcb8 Mon Sep 17 00:00:00 2001 From: Mix <32300164+mnixry@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:43:54 +0800 Subject: [PATCH] Add support for additional pull request events --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30943b8..628ef73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ name: CI on: push: pull_request_target: + types: [opened, synchronize, reopened] workflow_dispatch: env: @@ -13,6 +14,8 @@ jobs: build: runs-on: ubuntu-latest + if: '!startsWith(github.ref, "refs/pull/")' + permissions: id-token: write @@ -69,7 +72,8 @@ jobs: runs-on: ubuntu-latest needs: build - if: github.event_name != 'push' || !startsWith(github.event.pull_request.head.ref, 'ref/pull/') + permissions: + pull-requests: write steps: - uses: actions/checkout@v4 @@ -93,6 +97,7 @@ jobs: with: vercel-token: ${{ secrets.VERCEL_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }} + github-comment: ${{ github.event_name == 'pull_request_target' }} vercel-args: ${{ env.CHECKOUT_ENV == 'production' && '--prod' || ''}} vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}