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:
commit
5cf291c851
@ -10,7 +10,6 @@ async function run(): Promise<void> {
|
|||||||
const secretStr = core.getInput('secret')
|
const secretStr = core.getInput('secret')
|
||||||
const ignoreError = core.getInput('ignoreError') === 'true'
|
const ignoreError = core.getInput('ignoreError') === 'true'
|
||||||
const secret = secretStr === '' ? undefined : secretStr
|
const secret = secretStr === '' ? undefined : secretStr
|
||||||
const data = JSON.parse(body)
|
|
||||||
if (secret) {
|
if (secret) {
|
||||||
core.info('get secret, sign mode')
|
core.info('get secret, sign mode')
|
||||||
}
|
}
|
||||||
@ -22,7 +21,7 @@ async function run(): Promise<void> {
|
|||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const resp = await dingBot.rawSend(data)
|
const resp = await dingBot.rawSend(body)
|
||||||
|
|
||||||
if (resp?.errcode !== 0) {
|
if (resp?.errcode !== 0) {
|
||||||
if (ignoreError) {
|
if (ignoreError) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user