diff options
| author | SKi <megamanics@users.noreply.github.com> | 2023-04-14 03:26:47 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-14 06:26:47 -0400 |
| commit | 0023cf10d2f41d4eddfd3d6ad7ad99a1152ef708 (patch) | |
| tree | 54997dba50eeec3cbc1e3119122ed65b062042b2 /src/git-command-manager.ts | |
| parent | 72a27d858e989e4f80fdb9a9747ee908f946c62e (diff) | |
Fix: Checkout fail in self-hosted runners when faulty submodule are checked-in (#1196)
* Fix Self hosted runner issue wrt bad submodules - solution cleanup working space.
* Fix format with npm run format output
* Add mock implementation for new function submoduleStatus
* Add 2 test cases for submodule status.
* Codeql-Action Analyse revert v1 to v2
---------
Co-authored-by: Bassem Dghaidi <568794+Link-@users.noreply.github.com>
Co-authored-by: sminnie <minnie@sankhe.com>
Diffstat (limited to 'src/git-command-manager.ts')
| -rw-r--r-- | src/git-command-manager.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 01aedfe..ab07524 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -41,6 +41,7 @@ export interface IGitCommandManager { submoduleForeach(command: string, recursive: boolean): Promise<string> submoduleSync(recursive: boolean): Promise<void> submoduleUpdate(fetchDepth: number, recursive: boolean): Promise<void> + submoduleStatus(): Promise<boolean> tagExists(pattern: string): Promise<boolean> tryClean(): Promise<boolean> tryConfigUnset(configKey: string, globalConfig?: boolean): Promise<boolean> @@ -357,6 +358,12 @@ class GitCommandManager { await this.execGit(args) } + async submoduleStatus(): Promise<boolean> { + const output = await this.execGit(['submodule', 'status'], true) + core.debug(output.stdout) + return output.exitCode === 0 + } + async tagExists(pattern: string): Promise<boolean> { const output = await this.execGit(['tag', '--list', pattern]) return !!output.stdout.trim() |
