Update vars/notifyLark.groovy
This commit is contained in:
@@ -3,6 +3,7 @@ def call(Map args = [:]) {
|
|||||||
// ===== 参数 =====
|
// ===== 参数 =====
|
||||||
def publishEnvs = args.publishEnvs ?: 'production'
|
def publishEnvs = args.publishEnvs ?: 'production'
|
||||||
def branchName = args.branchName ?: (env.BRANCH_NAME ?: 'unknown')
|
def branchName = args.branchName ?: (env.BRANCH_NAME ?: 'unknown')
|
||||||
|
def webhookUrl = args.webhookUrl ?: env.XSH_FEISHU_WEBHOOK
|
||||||
|
|
||||||
// ===== Jenkins 内建上下文 =====
|
// ===== Jenkins 内建上下文 =====
|
||||||
def buildStatus = currentBuild.currentResult ?: 'UNKNOWN'
|
def buildStatus = currentBuild.currentResult ?: 'UNKNOWN'
|
||||||
@@ -50,7 +51,7 @@ def call(Map args = [:]) {
|
|||||||
httpRequest(
|
httpRequest(
|
||||||
httpMode: 'POST',
|
httpMode: 'POST',
|
||||||
contentType: 'APPLICATION_JSON',
|
contentType: 'APPLICATION_JSON',
|
||||||
url: env.XSH_FEISHU_WEBHOOK,
|
url: webhookUrl,
|
||||||
requestBody: groovy.json.JsonOutput.toJson(payload),
|
requestBody: groovy.json.JsonOutput.toJson(payload),
|
||||||
validResponseCodes: '200:299'
|
validResponseCodes: '200:299'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user