Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasKoller committed Oct 31, 2023
1 parent 0a81a8e commit b0ece5d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions vars/rocketSend.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ def void call(String webHook, String message, String avatar = null, Boolean rawM
data['avatar'] = avatar
}

def returnCode = sh(returnStatus: true, script:
'''
curl
-X POST "${webHook}"
-H "Content-Type: application/json"
--data "${groovy.json.JsonOutput.toJson(data)}"
'''
)
def curlCommand = 'curl ' +
' -X POST "' + webHook + '" ' +
' -H "Content-Type: application/json" ' +
' --data \'' + groovy.json.JsonOutput.toJson(data) \''

def returnCode = sh(script: curlCommand, returnStatus: true)

if (returnCode != 0) {
error("RocketChat notification failed!")
Expand Down

0 comments on commit b0ece5d

Please sign in to comment.