提交 bce0c5b5 编写于 作者: sinat_25235033's avatar sinat_25235033

support custom bot prefix message

上级 b0527a12
...@@ -6,7 +6,7 @@ The action for translating Non-English issues content to English. ...@@ -6,7 +6,7 @@ The action for translating Non-English issues content to English.
## Usage ## Usage
> Use the default bot @Issues-translate-bot > Use the default bot account @Issues-translate-bot
#### Create a workflow from this action #### Create a workflow from this action
...@@ -22,7 +22,13 @@ jobs: ...@@ -22,7 +22,13 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: tomsun28/issues-translate-action@v2.4 - uses: tomsun28/issues-translate-action@v2.5
with:
IS_MODIFY_TITLE: false
# not require, default false, . Decide whether to modify the issue title
# if true, the robot account @Issues-translate-bot must have modification permissions, invite @Issues-translate-bot to your project or use your custom bot.
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿
# not require. Customize the translation robot prefix message.
```` ````
...@@ -51,7 +57,7 @@ jobs: ...@@ -51,7 +57,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: tomsun28/issues-translate-action@v2.4 - uses: tomsun28/issues-translate-action@v2.5
with: with:
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
# Required, input your bot github token # Required, input your bot github token
...@@ -60,9 +66,16 @@ jobs: ...@@ -60,9 +66,16 @@ jobs:
# If input, BOT name must match github token # If input, BOT name must match github token
```` ````
## Other
1. invite @Issues-translate-bot to your project
Project -> Settings -> Manage access -> Invite a collaborator
Post an issue in [issues-translate-action](https://github.com/tomsun28/issues-translate-action) to let me konw, the @Issues-translate-bot will join soon.
## DEMO ## DEMO
![action-sample](dist/action-sample.png) ![action-sample](dist/action-sample.png)
**Have Fun!** **Have Fun!**
......
此差异由.gitattributes 抑制。
此差异由.gitattributes 抑制。
...@@ -36,7 +36,7 @@ async function run(): Promise<void> { ...@@ -36,7 +36,7 @@ async function run(): Promise<void> {
issueUser = issuePayload.issue.user.login issueUser = issuePayload.issue.user.login
originComment = issuePayload.issue.body originComment = issuePayload.issue.body
originTitle = issuePayload.issue.title originTitle = issuePayload.issue.title
translateOrigin = originComment + '@====@' + originTitle translateOrigin = originComment + '@@====' + originTitle
} }
// detect issue title comment body is english // detect issue title comment body is english
...@@ -85,7 +85,7 @@ async function run(): Promise<void> { ...@@ -85,7 +85,7 @@ async function run(): Promise<void> {
return return
} }
let translateBody:string[] = translateTmp.split('@====@') let translateBody:string[] = translateTmp.split('@@====')
let translateComment = null let translateComment = null
let translateTitle = null let translateTitle = null
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册