浏览代码

Add a workflow_dispatch input

Alex Dima 3 年之前
父节点
当前提交
51ab8d1537
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      .github/workflows/publish.yml

+ 10 - 1
.github/workflows/publish.yml

@@ -4,7 +4,12 @@ on:
   schedule:
     - cron: '0 7 * * *'
   # enable users to manually trigger with workflow_dispatch
-  workflow_dispatch: {}
+  workflow_dispatch:
+    inputs:
+      nightly:
+        description: 'is nightly?'
+        required: true
+        default: 'true'
 
 jobs:
   publish:
@@ -66,6 +71,7 @@ jobs:
         run: yarn test-browser --browser chromium
 
       - name: (vscode) Patch package.json version
+        if: ${{ github.event.inputs.nightly == 'true' }}
         run: node ./monaco-editor/.github/workflows/nightly/setNightlyVersion.js ./vscode/build/monaco/package.json
 
       - name: (vscode) Editor Distro
@@ -107,6 +113,7 @@ jobs:
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
 
       - name: Publish `monaco-editor-core`
+        if: ${{ github.event.inputs.nightly == 'true' }}
         working-directory: './vscode/out-monaco-editor-core'
         run: npm publish --tag next
 
@@ -114,6 +121,7 @@ jobs:
         run: npm config delete //registry.npmjs.org/:_authToken
 
       - name: (monaco-editor) Patch package.json version
+        if: ${{ github.event.inputs.nightly == 'true' }}
         run: node ./monaco-editor/.github/workflows/nightly/setNightlyVersion.js ./monaco-editor/package.json
 
       - name: (monaco-editor) execute `npm ci` (1)
@@ -169,5 +177,6 @@ jobs:
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
 
       - name: Publish `monaco-editor`
+        if: ${{ github.event.inputs.nightly == 'true' }}
         working-directory: './monaco-editor/release'
         run: npm publish --tag next