diff --git a/dist/index.js b/dist/index.js index 0f8bbae272e84900f1c7310ef5b5547fe26e0376..ef2e666563fda23ca2161b639eaff5806ef2ff23 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/dist/index.js.map b/dist/index.js.map index 447fdd29c9ec6872b9520798b3135ff04d5fd834..e754d60b98c0465b6e02e235f84d1305d659fa71 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/src/main.ts b/src/main.ts index dd42fc90e1138bdc34bdfe4a1f0c4eef7bf269b7..af5a718175c4f0fc5d49079b0e70b43c73ac3c4e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -34,18 +34,6 @@ async function run(): Promise { issueUser = issuePayload.issue.user.login originComment = issuePayload.issue.body originTitle = issuePayload.issue.title - - if (isModifyTitle === 'true') { - originComment = issuePayload.issue.body - originTitle = issuePayload.issue.title - } else { - originComment = - ` - **Title:** ${issuePayload.issue.title} - - ${issuePayload.issue.body} - ` - } } let translateOrigin = originComment + '@====@' + originTitle @@ -78,6 +66,7 @@ async function run(): Promise { return } + core.info(`translate origin body is: ${translateOrigin}`) // translate issue comment body to english const translateTmp = await translateIssueOrigin(translateOrigin) @@ -93,6 +82,7 @@ async function run(): Promise { let translateComment = null let translateTitle = null + core.info(`translate body is: ${translateTmp}`) if (translateBody.length == 1) { translateComment = translateBody[0] @@ -126,7 +116,7 @@ ${translateComment} ` } - if (isModifyTitle === 'true') { + if (isModifyTitle === 'true' && translateTitle != null) { await modifyTitle(issueNumber, translateTitle, octokit) }