fix translate error when issues with no comment #11

This commit is contained in:
tomsun28
2020-11-16 22:18:15 +08:00
parent 38be3f2b3b
commit bd7d800b77
5 changed files with 16 additions and 19 deletions
+1 -6
View File
@@ -1,10 +1,5 @@
name: 'build-test'
on: # rebuild any PRs and main branch changes
issue_comment:
issues:
branches:
- main
- 'releases/*'
on: [issue_coment, issues]
jobs:
build: # make sure build/ci work properly
+2 -10
View File
@@ -12,11 +12,7 @@ The action for translating non-English issues comment content to English.
````
name: 'issue-comment-translator'
on: # support issue_comment issue
issues:
issue_comment:
branches:
- main
on: [issues, issue_comment]
jobs:
build:
@@ -42,11 +38,7 @@ jobs:
4. Create a workflow from this action
````
name: 'issue-comment-translator'
on: # support issue_comment issue
issues:
issue_comment:
branches:
- main
on: [issues, issue_comment]
jobs:
build:
Generated Vendored
+6 -1
View File
@@ -4473,7 +4473,12 @@ function run() {
const issuePayload = github.context.payload;
issueNumber = issuePayload.issue.number;
issueUser = issuePayload.issue.user.login;
originBody = issuePayload.issue.body;
originBody =
`
**Title:** ${issuePayload.issue.title}
${issuePayload.issue.body}
`;
}
// detect comment body is english
if (detectIsEnglish(originBody)) {
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+6 -1
View File
@@ -29,7 +29,12 @@ async function run(): Promise<void> {
const issuePayload = github.context.payload as webhook.EventPayloads.WebhookPayloadIssues
issueNumber = issuePayload.issue.number
issueUser = issuePayload.issue.user.login
originBody = issuePayload.issue.body
originBody =
`
**Title:** ${issuePayload.issue.title}
${issuePayload.issue.body}
`
}
// detect comment body is english