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') {
|
||||
when {
|
||||
expression { !IS_PROTECTED_BRANCH }
|
||||
expression { !PROTECTED_BRANCH }
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
def changeLog = currentBuild.changeSets.collectMany { it.items.collect { it.affectedFiles.collect { it.path } }.flatten() }.flatten()
|
||||
def hasChangelogChanges = changeLog.any { it == 'CHANGELOG.md' }
|
||||
def diffOutput = sh(
|
||||
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) {
|
||||
error "No se han detectado cambios en CHANGELOG.md"
|
||||
if (!hasChangelog) {
|
||||
error "❌ No se han detectado cambios en CHANGELOG.md respecto a ${TARGET_BRANCH}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue