Try to fix model check (#6227)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-08-02 09:48:12 +05:00 committed by GitHub
parent 3d42ba4e96
commit 8d841dc854
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,6 +5,7 @@ exec('git describe --tags `git rev-list --tags --max-count=1`', (err, stdout, st
process.exit(1)
}
const tag = stdout.trim()
console.log('Check changes for tag:', tag)
exec(`git fetch --tags && git diff ${tag} --name-only`, (err, stdout, stderr) => {
if (err !== null) {
process.exit(1)
@ -13,8 +14,8 @@ exec('git describe --tags `git rev-list --tags --max-count=1`', (err, stdout, st
const modelsChanged = changedFiles.some(file => file.startsWith('models/'))
const versionChanged = changedFiles.some(file => file.endsWith('version.txt'))
if (modelsChanged && !versionChanged) {
console.log('Please update model version')
process.exit(1)
throw new Error('Please update model version')
}
console.log('OK')
})
})