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

View File

@ -96,9 +96,19 @@ module.exports = new (class Git {
* *
* @return {Promise<>} * @return {Promise<>}
*/ */
pull = () => ( pull = async() => {
this.exec(`pull --unshallow --tags ${core.getInput('git-pull-method')}`) 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 * Push all changes
@ -109,6 +119,17 @@ module.exports = new (class Git {
this.exec(`push origin ${branch} --follow-tags`) 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 * Updates the origin remote
* *