fix: should fix unshallow repo
This commit is contained in:
parent
9badeafda3
commit
17c5d8550a
13
src/git.ts
13
src/git.ts
@ -23,6 +23,14 @@ export default new (class Git {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isShallow = async () => {
|
||||||
|
const isShallow: string = await this.exec(
|
||||||
|
'rev-parse --is-shallow-repository'
|
||||||
|
);
|
||||||
|
|
||||||
|
return isShallow.trim().replace('\n', '') === 'true';
|
||||||
|
};
|
||||||
|
|
||||||
exec = (command: string): Promise<string> => {
|
exec = (command: string): Promise<string> => {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
let execOutput = '';
|
let execOutput = '';
|
||||||
@ -56,6 +64,11 @@ export default new (class Git {
|
|||||||
pull = async () => {
|
pull = async () => {
|
||||||
const args = ['pull'];
|
const args = ['pull'];
|
||||||
|
|
||||||
|
// Check if the repo is unshallow
|
||||||
|
if (await this.isShallow()) {
|
||||||
|
args.push('--unshallow');
|
||||||
|
}
|
||||||
|
|
||||||
args.push('--tags');
|
args.push('--tags');
|
||||||
args.push(core.getInput('git-pull-method'));
|
args.push(core.getInput('git-pull-method'));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user