File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 7
7
tags :
8
8
- " v*"
9
9
10
+ # workflow_dispatch 是 GitHub 的手动触发 CI 机制,可以与 inputs 预定义的变量一起使用,对 push 触发的 CI 不生效。
10
11
workflow_dispatch :
11
12
inputs :
12
13
docker :
@@ -100,14 +101,21 @@ jobs:
100
101
101
102
deploy-to-deno :
102
103
needs : [upload-art]
103
- if : ${{ inputs.deno || github.event_name == 'push' }}
104
+ # 参考链接:https://docs.github.com/zh/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context
105
+ # 需求是不让下面的 release-docker 任务在 push 触发的 CI 中执行。
106
+ # 在 jobs.<job_id>.if 中没办法使用 env 环境变量,因此没办法根据变量的值处理 push 触发的 CI 是否进行这一步。jobs.<job_id>.steps.if 是可以使用 env 的,因此只能在 steps 里面处理了。
107
+ if : ${{ inputs.deno || ( github.event_name == 'push') }}
104
108
runs-on : ubuntu-latest
105
109
permissions :
106
110
id-token : write
107
111
contents : read
108
112
113
+ env :
114
+ DEPLOY_DENO_PUSH : false
115
+
109
116
steps :
110
117
- uses : actions/download-artifact@v4
118
+ if : ${{ DEPLOY_DENO_PUSH }}
111
119
with :
112
120
name : deno.js
113
121
- name : Upload to Deno Deploy
You can’t perform that action at this time.
0 commit comments