Add bare option to checkout action

Fixes #603
This commit is contained in:
Mohammad Ismail 2024-11-27 13:44:30 +01:00
parent cbb722410c
commit 83f93bf255
4 changed files with 159 additions and 110 deletions

View file

@ -110,7 +110,11 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))
) {
core.startGroup('Initializing the repository')
await git.init()
const initArgs = ['init']
if (settings.bare) {
initArgs.push('--bare')
}
await git.execGit(initArgs)
await git.remoteAdd('origin', repositoryUrl)
core.endGroup()
}