From 4ef74b38eb9fa375f990b73eb377d68954840b18 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 6 Feb 2026 20:34:23 +0100 Subject: [PATCH] Actualizar Jenkinsfile.ci --- Jenkinsfile.ci | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile.ci b/Jenkinsfile.ci index 118bed2..74ecf7f 100644 --- a/Jenkinsfile.ci +++ b/Jenkinsfile.ci @@ -116,18 +116,21 @@ post { def commentsUrl = "${giteaBase}/gitea/api/v1/repos/${owner}/${repo}/issues/${pr}/comments" - withCredentials([string(credentialsId: 'jenkins-bot-api', variable: 'GITEA_TOKEN')]) { - sh """ - set -e - curl -sS -X POST \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -H "Content-Type: application/json" \ - --data @- \ - '${commentsUrl}' <<'JSON' -{"body":"${msg.replace('\\', '\\\\').replace('"','\\"')}"} -JSON - """ - } + withCredentials([usernamePassword(credentialsId: 'jenkins-bot-api', + usernameVariable: 'GITEA_USER', + passwordVariable: 'GITEA_TOKEN')]) { + sh """ + set -e + curl -sS -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + --data @- \ + '${commentsUrl}' <<'JSON' + {"body":"${msg.replace('\\', '\\\\').replace('"','\\"')}"} + JSON + """ + } + } else { echo "No es build de PR (CHANGE_ID vacĂ­o); no comento." }