Merge pull request #70 from TriPSs/master

Release
releases/v3
Tycho Bokdam 2020-10-30 23:27:06 +01:00 committed by GitHub
commit 817cf64020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 639 additions and 552 deletions

1130
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,19 +24,19 @@
},
"main": "src/index.js",
"dependencies": {
"@actions/core": "1.2.4",
"@actions/core": "1.2.6",
"@actions/exec": "1.0.4",
"@iarna/toml": "^2.2.5",
"conventional-changelog": "3.1.21",
"conventional-recommended-bump": "6.0.9",
"git-semver-tags": "4.0.0",
"object-path": "^0.11.4",
"semver": "^6.0.0",
"conventional-changelog": "3.1.23",
"conventional-recommended-bump": "6.0.10",
"git-semver-tags": "4.1.0",
"object-path": "^0.11.5",
"semver": "^7.3.2",
"yaml": "^1.10.0"
},
"devDependencies": {
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"husky": "4.2.5"
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"husky": "4.3.0"
}
}

View File

@ -96,9 +96,19 @@ module.exports = new (class Git {
*
* @return {Promise<>}
*/
pull = () => (
this.exec(`pull --unshallow --tags ${core.getInput('git-pull-method')}`)
)
pull = async() => {
const args = ['pull']
// Check if the repo is unshallow
if (await this.isShallow()) {
args.push('--unshallow')
}
args.push('--tags')
args.push(core.getInput('git-pull-method'))
return this.exec(args.join(' '))
}
/**
* Push all changes
@ -109,6 +119,17 @@ module.exports = new (class Git {
this.exec(`push origin ${branch} --follow-tags`)
)
/**
* Check if the repo is shallow
*
* @return {Promise<>}
*/
isShallow = async () => {
const isShallow = await this.exec('rev-parse --is-shallow-repository')
return isShallow.trim().replace('\n', '') === 'true'
}
/**
* Updates the origin remote
*