Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sureness
Issues Translate Action
提交
326a99ef
I
Issues Translate Action
项目概览
sureness
/
Issues Translate Action
通知
2
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
Issues Translate Action
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
326a99ef
编写于
11月 13, 2020
作者:
sinat_25235033
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
issues-translte-action is ready
上级
fe4e17e7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
29 addition
and
6 deletion
+29
-6
README.md
README.md
+21
-3
action.yml
action.yml
+0
-1
dist/index.js
dist/index.js
+0
-0
dist/index.js.map
dist/index.js.map
+0
-0
src/main.ts
src/main.ts
+8
-2
未找到文件。
README.md
浏览文件 @
326a99ef
...
...
@@ -8,6 +8,27 @@ The action for translating non-English issues comment content to English.
#### Create a workflow from this action
````
name: 'issue-comment-translator'
on: # only support issue_comment
issue_comment:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: tomsun28/issues-translate-action@v1
````
## Custom
#### Create a workflow from this action
````
name: 'issue-comment-translator'
on: # only support issue_comment
...
...
@@ -27,9 +48,6 @@ jobs:
````
#### Create an issues comment and test
**Have Fun!**
...
...
action.yml
浏览文件 @
326a99ef
...
...
@@ -3,7 +3,6 @@ description: 'The action for translating non-english issues content to english.'
author
:
'
tomsun28'
inputs
:
BOT_GITHUB_TOKEN
:
required
:
true
description
:
'
The
issue
comment
bot
GITHUB_TOKEN.'
BOT_LOGIN_NAME
:
description
:
'
The
issue
comment
bot
github
login
name.'
...
...
dist/index.js
浏览文件 @
326a99ef
此差异由.gitattributes 抑制。
dist/index.js.map
浏览文件 @
326a99ef
此差异由.gitattributes 抑制。
src/main.ts
浏览文件 @
326a99ef
...
...
@@ -27,10 +27,16 @@ async function run(): Promise<void> {
}
// ignore when bot comment issue himself
const
myToken
=
core
.
getInput
(
'
BOT_GITHUB_TOKEN
'
)
let
myToken
=
core
.
getInput
(
'
BOT_GITHUB_TOKEN
'
)
let
bot_login_name
=
core
.
getInput
(
'
BOT_LOGIN_NAME
'
)
if
(
myToken
===
null
||
myToken
===
undefined
||
myToken
===
''
)
{
// use the default github bot token
myToken
=
'
0fe5bf6b25e0f88fab4a51b70027d71f3b43144a
'
bot_login_name
=
'
Issues-translate-bot
'
}
let
octokit
=
null
;
const
issue_user
=
issueCommentPayload
.
comment
.
user
.
login
let
bot_login_name
=
core
.
getInput
(
'
BOT_LOGIN_NAME
'
)
if
(
bot_login_name
===
null
||
bot_login_name
===
undefined
||
bot_login_name
===
''
)
{
octokit
=
github
.
getOctokit
(
myToken
)
const
botInfo
=
await
octokit
.
request
(
'
GET /user
'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录