From b00b386c2148f06dadd096fd5eb10cba21969333 Mon Sep 17 00:00:00 2001 From: Timothy Yin Date: Sun, 8 Feb 2026 20:27:06 +0800 Subject: [PATCH] Update feishu_notify.sh --- feishu_notify.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/feishu_notify.sh b/feishu_notify.sh index ba9fc47..d378d57 100644 --- a/feishu_notify.sh +++ b/feishu_notify.sh @@ -3,14 +3,13 @@ set -e # ===== 参数校验 ===== : "${FEISHU_WEBHOOK:?FEISHU_WEBHOOK not set}" -: "${JENKINS_USER:?JENKINS_USER not set}" -: "${JENKINS_TOKEN:?JENKINS_TOKEN not set}" +: "${JENKINS_API_CREDENTIAL:?JENKINS_API_CREDENTIAL not set}" # ===== 获取构建状态 ===== getBuildState() { local buildNr=$1 - curl -s -u "${JENKINS_USER}:${JENKINS_TOKEN}" \ - "${JOB_URL}/${buildNr}/api/json" \ + curl -s -u "${JENKINS_API_CREDENTIAL}" \ + "${BUILD_URL}api/json" \ | grep -Po '"result":\s*"\K\w+' }