Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gitcode_dev
Learning Lab 手册
提交
28278914
L
Learning Lab 手册
项目概览
gitcode_dev
/
Learning Lab 手册
通知
3
Star
0
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
Learning Lab 手册
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
28278914
编写于
3月 16, 2021
作者:
张重言
🌈
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完善events的文档
上级
e5af74b6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
129 addition
and
1 deletion
+129
-1
src/course/actions.md
src/course/actions.md
+129
-1
未找到文件。
src/course/actions.md
浏览文件 @
28278914
...
...
@@ -14,4 +14,132 @@
-
wiki
-
commit
-
deployment
-
alert
\ No newline at end of file
-
alert
## push
使用push类型来监听用户仓库的推送代码事件
### 示例
在使用
`transitions`
中监听用户的push事件并执行相应的
`action`
,当用户向
`feature1`
推送代码的时候,触发相应的action
```
yaml
step1
:
link
:
'
{{first_issue_url}}'
description
:
"
第一步"
transitions
:
events
:
[
'
push'
]
with
:
'
feature1'
action
:
-
type
:
issue_comment.created
with
:
comment.md
to
:
step9
```
### Options
当
`events`
为push的时候,支持的参数
| 参数 | 类型 | 描述 | 默认 | 是否为必要参数 |
| --- | --- | --- | --- | --- |
| with | String | 监听用户推送到的分支 | | 是 |
## note
使用push类型来监听用户仓库的推送代码事件
### 示例
在使用
`transitions`
中监听用户的note(评论)事件并执行相应的
`action`
,当用户回复相应内容的时候,触发相应的
`action`
```
yaml
step1
:
link
:
'
{{first_issue_url}}'
description
:
"
不同操作系统的安装介绍"
transitions
:
-
events
:
[
'
note_events'
]
with
:
A
action
:
-
type
:
issue_comment.created
with
:
004_3_window_git_install.md
-
type
:
choice
with
:
next.md
to
:
step2
-
events
:
[
'
note_events'
]
with
:
B
action
:
-
type
:
issue_comment.created
with
:
004_4_macOS_git_install.md
-
type
:
choice
with
:
next.md
to
:
step2
-
events
:
[
'
note_events'
]
with
:
C
action
:
-
type
:
issue_comment.created
with
:
004_5_linux_git_install.md
-
type
:
choice
with
:
next.md
to
:
step2
```
也可以使用正则匹配来匹配用户输入评论的内容,如果用户评论的内容和正则表达式相匹配,则出发相应的
`action`
```
yaml
step1
:
link
:
'
{{first_issue_url}}'
description
:
"
使用正则匹配标题"
transitions
:
-
events
:
[
'
note_events'
]
left
:
'
/^#{1,6}\s.+/'
operator
:
regexp
right
:
'
{{object_attributes.note}}'
action
:
-
type
:
issue_comment.created
with
:
nice_job.md
to
:
step2
```
### Options
当
`events`
为note的时候,支持的参数
| 参数 | 类型 | 描述 | 默认 | 是否为必要参数 |
| --- | --- | --- | --- | --- |
| with | String | 用户回复的内容 | | 否 |
| left | String | 正则表达式 | | 否 |
| operator | String | 操作符,这里使用正则匹配,应该为regexp | | 否 |
| right | String | 监听到符合条件的对象的属性,object_attributes为对象的所有属性,这里用到的属性为note | | 否 |
## issue
使用push类型来监听用户仓库的推送代码事件
### 示例
在使用
`transitions`
中监听用户的issue事件并执行相应的
`action`
,下面的示例是指当用户关闭一个issue的时候,触发相应的action
```
yaml
step6
:
link
:
'
{{chapter_3_issue}}'
description
:
"
完成当前章节学习"
transitions
:
events
:
[
'
close_issue'
]
action
:
-
type
:
create_issue
title
:
"
Markdown
:链接"
with
:
004_1_link_basic.md
store
:
chapter_4_issue
:
'
{{result.data.html_url}}'
-
type
:
issue_comment.created
with
:
003_5_end_2.md
to
:
end
```
### Options
`close_issue`
事件无需额外的参数,系统默认会匹配step中的
`link`
参数指向的issue
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录