fix: More checks. Fix test for changelog generation

releases/v3
Egor Kurnev 2020-12-14 19:38:42 +03:00
parent c0f41727e6
commit c6043fb4f9
3 changed files with 10 additions and 4 deletions

View File

@ -105,7 +105,6 @@ jobs:
github-token: ${{ secrets.github_token }}
pre-changelog-generation: test/pre-changelog-generation.js
version-file: './test-file.toml'
skip-on-empty: 'false'
- run: test -f pre-changelog-generation.test.json || (echo should be here && exit 1)
- run: cat pre-changelog-generation.test.json

View File

@ -127,7 +127,12 @@ module.exports = new (class Git {
isShallow = async () => {
const isShallow = await this.exec('rev-parse --is-shallow-repository')
return isShallow.trim().replace('\n', '') === 'true'
// isShallow does not return anything on local machine
if (isShallow) {
return isShallow.trim().replace('\n', '') === 'true'
} else {
return false
}
}
/**

View File

@ -118,8 +118,10 @@ async function run() {
version: newVersion,
})
gitTag = newVersionAndTag.tag
newVersion = newVersionAndTag.version
if (newVersionAndTag) {
if (newVersionAndTag.tag) gitTag = newVersionAndTag.tag
if (newVersionAndTag.version) newVersion = newVersionAndTag.version
}
}
// Generate the string changelog