@@ -60,7 +60,9 @@ actions 是 GitHub Actions 的核心,简单来说,它其实就是一段可
6060# 工作流名称
6161name : Docker Image CI
6262
63- # on设置触发工作流的事件:当有pull到master,pr到master,每隔十五分钟运行一次
63+ # on设置触发工作流的事件:当有pull到master,pr到master,每隔十五分钟运行一次。三个条件满足一个都会运行。
64+
65+ # 事件列表 https://docs.github.com/cn/free-pro-team@latest/actions/reference/events-that-trigger-workflows
6466on :
6567 push :
6668 branches : [ master ]
6971 schedule :
7072 - cron: '*/15 * * * *'
7173
72- # 工作流的作业
73- jobs :
74- # 第一个job是构建
75- build :
76- name : build a test image
77-
78- runs-on : ubuntu-latest
7974
80- steps :
81- - uses : actions/checkout@v2
75+ jobs : # 工作流的作业
76+ build : # 第一个job是build
77+ name : build a test image # 指定job名称,构建测试任务
78+ runs-on : ubuntu-latest # 指定运行环境
79+
80+ steps : # 作业包含一系列任务,用steps表示
81+ - uses : actions/checkout@v2 # 复用官方actions,签出代码
82+ with :
83+
8284 - name : Build the Docker image
8385 run : docker build . --file Dockerfile --tag kms-server:$(date +%s)
86+
87+
88+ second :
89+
90+ name : build
8491
8592```
8693
8794
8895
96+
97+
98+
99+
100+
101+
102+
103+
104+ ## 自动分发issue
105+
106+ https://github.com/pingcap/tidb/blob/master/.github/workflows/assign_project.yml
107+
108+
109+
110+
111+
112+
113+
114+
115+
116+
117+
118+ ``` yaml
119+ # 自动分发issue
120+ name : Auto Assign Project Local
121+
122+ # 当issues被打上标签即会触发
123+ on :
124+ issues :
125+ types : [labeled]
126+ env :
127+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
128+
129+ jobs :
130+ assign_one_project :
131+ runs-on : ubuntu-latest
132+ name : Assign to One Project
133+ steps :
134+ #
135+ - name : Run issues assignment to project SIG Runtime Kanban
136+ 137+ if : |
138+ contains(github.event.issue.labels.*.name, 'component/coprocessor') ||
139+ contains(github.event.issue.labels.*.name, 'sig/executor') ||
140+ contains(github.event.issue.labels.*.name, 'component/expression')
141+ with :
142+ project : ' https://github.com/pingcap/tidb/projects/38'
143+ column_name : ' Issue Backlog: Need Triage'
144+ - name : Run issues assignment to project SIG Planner Kanban
145+ 146+ if : |
147+ contains(github.event.issue.labels.*.name, 'sig/planner') ||
148+ contains(github.event.issue.labels.*.name, 'component/statistics') ||
149+ contains(github.event.issue.labels.*.name, 'component/bindinfo')
150+ with :
151+ project : ' https://github.com/pingcap/tidb/projects/39'
152+ column_name : ' Issue Backlog: Need Triage'
153+ - name : Run issues assignment to Feature Request Kanban
154+ 155+ if : |
156+ contains(github.event.issue.labels.*.name, 'type/feature-request')
157+ with :
158+ project : ' https://github.com/pingcap/tidb/projects/41'
159+ column_name : ' Need Triage'
160+ - name : Run issues assignment to Robust test
161+ 162+ if : |
163+ contains(github.event.issue.labels.*.name, 'component/test')
164+ with :
165+ project : ' https://github.com/pingcap/tidb/projects/32'
166+ column_name : ' TODO/Help Wanted'
167+ - name : Run issues assignment to project UT Coverage
168+ 169+ if : |
170+ contains(github.event.issue.labels.*.name, 'type/UT-coverage')
171+ with :
172+ project : ' https://github.com/pingcap/tidb/projects/44'
173+ column_name : ' To do'
174+ - name : Run issues assignment to project SIG DDL Kanban
175+ 176+ if : |
177+ contains(github.event.issue.labels.*.name, 'sig/DDL') ||
178+ contains(github.event.issue.labels.*.name, 'component/binlog') ||
179+ contains(github.event.issue.labels.*.name, 'component/charset') ||
180+ contains(github.event.issue.labels.*.name, 'component/infoschema') ||
181+ contains(github.event.issue.labels.*.name, 'component/parser')
182+ with :
183+ project : ' https://github.com/pingcap/tidb/projects/40'
184+ column_name : ' Issue Backlog: Need Triage'
185+ ` ` `
186+
187+
188+
189+
190+
191+
192+
193+
194+
195+ ## 官方 Actions
196+
197+
198+
199+
200+
201+ ### ctions/checkout
202+
203+
204+
205+ https://github.com/actions/checkout
0 commit comments