commit
de44c38e9c
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
|
@ -27,16 +27,16 @@
|
||||||
"@actions/core": "1.2.6",
|
"@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.5",
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue