Unshallow on fetch

This commit is contained in:
Peter Evans 2020-07-18 16:04:36 +09:00
parent 053b501145
commit f4ee4a8333
3 changed files with 185 additions and 0 deletions

View file

@ -1,5 +1,7 @@
import * as exec from '@actions/exec'
import * as io from '@actions/io'
import * as fshelper from './fs-helper'
import * as path from 'path'
const tagsRefSpec = '+refs/tags/*:refs/tags/*'
@ -114,6 +116,13 @@ export class GitCommandManager {
}
args.push('--progress', '--no-recurse-submodules')
if (
fshelper.fileExistsSync(
path.join(this.workingDirectory, '.git', 'shallow')
)
) {
args.push('--unshallow')
}
if (options) {
args.push(...options)