未验证 提交 7fa8d124 编写于 作者: sinat_25235033's avatar sinat_25235033 提交者: GitHub

Merge pull request #12 from tomsun28/bugfix#11

fix translate error when issues with no comment #11 and change action name
name: 'build-test' name: 'build-test'
on: # rebuild any PRs and main branch changes on: [issue_comment, issues]
issue_comment:
issues:
branches:
- main
- 'releases/*'
jobs: jobs:
build: # make sure build/ci work properly build: # make sure build/ci work properly
......
...@@ -12,11 +12,7 @@ The action for translating non-English issues comment content to English. ...@@ -12,11 +12,7 @@ The action for translating non-English issues comment content to English.
```` ````
name: 'issue-comment-translator' name: 'issue-comment-translator'
on: # support issue_comment issue on: [issues, issue_comment]
issues:
issue_comment:
branches:
- main
jobs: jobs:
build: build:
...@@ -42,11 +38,7 @@ jobs: ...@@ -42,11 +38,7 @@ jobs:
4. Create a workflow from this action 4. Create a workflow from this action
```` ````
name: 'issue-comment-translator' name: 'issue-comment-translator'
on: # support issue_comment issue on: [issues, issue_comment]
issues:
issue_comment:
branches:
- main
jobs: jobs:
build: build:
......
name: 'issues translate action' name: 'Issues Translator'
description: 'The action for translating non-english issues content to english.' description: 'The action for translating non-english issues content to english.'
branding: branding:
icon: 'disc' icon: 'disc'
......
此差异由.gitattributes 抑制。
此差异由.gitattributes 抑制。
...@@ -29,7 +29,12 @@ async function run(): Promise<void> { ...@@ -29,7 +29,12 @@ async function run(): Promise<void> {
const issuePayload = github.context.payload as webhook.EventPayloads.WebhookPayloadIssues const issuePayload = github.context.payload as webhook.EventPayloads.WebhookPayloadIssues
issueNumber = issuePayload.issue.number issueNumber = issuePayload.issue.number
issueUser = issuePayload.issue.user.login issueUser = issuePayload.issue.user.login
originBody = issuePayload.issue.body originBody =
`
**Title:** ${issuePayload.issue.title}
${issuePayload.issue.body}
`
} }
// detect comment body is english // detect comment body is english
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册