Update jenkinsfile.ci #30

Merged
husbando_enjoyer merged 13 commits from feature/main-UpdateJenkinsFileCi into main 2026-02-06 21:39:23 +01:00
Showing only changes of commit 4ef74b38eb - Show all commits

View File

@@ -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."
}