Actualizar Jenkinsfile.ci
All checks were successful
Tests / Declarative: Post Actions passed: 5
CI-Multi/pipeline/pr-main This commit looks good

This commit is contained in:
2026-02-06 20:34:23 +01:00
parent 214aec2e73
commit 4ef74b38eb

View File

@@ -116,7 +116,9 @@ post {
def commentsUrl = "${giteaBase}/gitea/api/v1/repos/${owner}/${repo}/issues/${pr}/comments" def commentsUrl = "${giteaBase}/gitea/api/v1/repos/${owner}/${repo}/issues/${pr}/comments"
withCredentials([string(credentialsId: 'jenkins-bot-api', variable: 'GITEA_TOKEN')]) { withCredentials([usernamePassword(credentialsId: 'jenkins-bot-api',
usernameVariable: 'GITEA_USER',
passwordVariable: 'GITEA_TOKEN')]) {
sh """ sh """
set -e set -e
curl -sS -X POST \ curl -sS -X POST \
@@ -124,10 +126,11 @@ post {
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
--data @- \ --data @- \
'${commentsUrl}' <<'JSON' '${commentsUrl}' <<'JSON'
{"body":"${msg.replace('\\', '\\\\').replace('"','\\"')}"} {"body":"${msg.replace('\\', '\\\\').replace('"','\\"')}"}
JSON JSON
""" """
} }
} else { } else {
echo "No es build de PR (CHANGE_ID vacío); no comento." echo "No es build de PR (CHANGE_ID vacío); no comento."
} }