fix: refs #8715 update changelog verification in Jenkinsfile to compare with TARGET_BRANCH
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit
Details
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit
Details
This commit is contained in:
parent
a32a95b088
commit
c3811d3318
|
@ -77,15 +77,19 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Changelog') {
|
stage('Changelog') {
|
||||||
when {
|
when {
|
||||||
expression { !IS_PROTECTED_BRANCH }
|
expression { !PROTECTED_BRANCH }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def changeLog = currentBuild.changeSets.collectMany { it.items.collect { it.affectedFiles.collect { it.path } }.flatten() }.flatten()
|
def diffOutput = sh(
|
||||||
def hasChangelogChanges = changeLog.any { it == 'CHANGELOG.md' }
|
script: "git fetch origin ${TARGET_BRANCH} && git diff --name-only origin/${TARGET_BRANCH}",
|
||||||
|
returnStdout: true
|
||||||
|
).trim().split('\n')
|
||||||
|
echo "DIFF: ${diffOutput}"
|
||||||
|
def hasChangelog = diffOutput.any { it == 'CHANGELOG.md' }
|
||||||
|
|
||||||
if (!hasChangelogChanges) {
|
if (!hasChangelog) {
|
||||||
error "No se han detectado cambios en CHANGELOG.md"
|
error "❌ No se han detectado cambios en CHANGELOG.md respecto a ${TARGET_BRANCH}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue