浏览代码

add workflow_dispatch

孙高猛 1 年之前
父节点
当前提交
0739ced407
共有 1 个文件被更改,包括 9 次插入6 次删除
  1. 9 6
      .github/workflows/deploy_preview.yml

+ 9 - 6
.github/workflows/deploy_preview.yml

@@ -1,5 +1,12 @@
 name: VercelPreviewDeployment
 
+on:
+  workflow_dispatch:
+    inputs:
+      branchName:
+        description: 'Branch to deploy'
+        required: true
+
 env:
   VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
   VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
@@ -11,17 +18,13 @@ permissions:
   statuses: write
   pull-requests: write
 
-on:
-  pull_request:
-    types:
-      - opened
-      - synchronize
-
 jobs:
   deploy-preview:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
+        with:
+          ref: ${{ github.event.inputs.branchName }}
 
       - name: Extract branch name
         shell: bash