ci: refs #8698 extract lastSuccessfulBuild
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
95f9917dc2
commit
a250cc0eb5
|
@ -90,22 +90,22 @@ pipeline {
|
|||
lastSuccessfulBuild = lastSuccessfulBuild.previousBuild
|
||||
}
|
||||
|
||||
if (lastSuccessfulBuild != null) {
|
||||
if (lastSuccessfulBuild != null && lastSuccessfulBuild.changesets.size() > 0) {
|
||||
echo "lastSuccessfulBuild ${lastSuccessfulBuild}"
|
||||
// Extraer el commit del build exitoso desde el changelog
|
||||
def lastCommitHash = ""
|
||||
// for (changeSet in lastSuccessfulBuild.changesets) {
|
||||
// for (change in changeSet.items) {
|
||||
// echo "Autor: ${change.author}"
|
||||
// echo "Comentario: ${change.comment}"
|
||||
// echo "Archivos modificados: ${change.affectedPaths}"
|
||||
// echo "Commit: ${change.commitId}"
|
||||
// }
|
||||
// }
|
||||
for (changeSet in lastSuccessfulBuild.changesets) {
|
||||
for (change in changeSet.items) {
|
||||
echo "Autor: ${change.author}"
|
||||
echo "Comentario: ${change.comment}"
|
||||
echo "Archivos modificados: ${change.affectedPaths}"
|
||||
echo "Commit: ${change.commitId}"
|
||||
}
|
||||
}
|
||||
|
||||
// if (lastCommitHash) {
|
||||
// echo "Último commit exitoso: ${lastCommitHash}"
|
||||
// }
|
||||
if (lastCommitHash) {
|
||||
echo "Último commit exitoso: ${lastCommitHash}"
|
||||
}
|
||||
} else {
|
||||
lastCommitHash = sh(script: "git rev-parse origin/${env.CHANGE_TARGET}}", returnStdout: true).trim()
|
||||
echo "Hash obtenido con git: ${lastCommitHash}"
|
||||
|
|
Loading…
Reference in New Issue