Merge pull request #4 from kuitos/fix/unnessary-json-parse

fix: parse body may cause JSON parse error while send markdown message
This commit is contained in:
featherlight 2020-07-06 11:28:55 +08:00 committed by GitHub
commit 5cf291c851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -10,7 +10,6 @@ async function run(): Promise<void> {
const secretStr = core.getInput('secret')
const ignoreError = core.getInput('ignoreError') === 'true'
const secret = secretStr === '' ? undefined : secretStr
const data = JSON.parse(body)
if (secret) {
core.info('get secret, sign mode')
}
@ -22,7 +21,7 @@ async function run(): Promise<void> {
})
try {
const resp = await dingBot.rawSend(data)
const resp = await dingBot.rawSend(body)
if (resp?.errcode !== 0) {
if (ignoreError) {