Actualizar Jenkinsfile.ci
This commit is contained in:
@@ -116,18 +116,21 @@ 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',
|
||||||
sh """
|
usernameVariable: 'GITEA_USER',
|
||||||
set -e
|
passwordVariable: 'GITEA_TOKEN')]) {
|
||||||
curl -sS -X POST \
|
sh """
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
set -e
|
||||||
-H "Content-Type: application/json" \
|
curl -sS -X POST \
|
||||||
--data @- \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
'${commentsUrl}' <<'JSON'
|
-H "Content-Type: application/json" \
|
||||||
{"body":"${msg.replace('\\', '\\\\').replace('"','\\"')}"}
|
--data @- \
|
||||||
JSON
|
'${commentsUrl}' <<'JSON'
|
||||||
"""
|
{"body":"${msg.replace('\\', '\\\\').replace('"','\\"')}"}
|
||||||
}
|
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."
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user