diff --git a/dist/index.js b/dist/index.js index fe3f317..98aa668 100644 --- a/dist/index.js +++ b/dist/index.js @@ -780,9 +780,9 @@ class GitCommandManager { yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`); }); } - checkout(ref, startPoint) { + checkout(ref, startPoint, showProgress) { return __awaiter(this, void 0, void 0, function* () { - const args = ['checkout', '--progress', '--force']; + const args = ['checkout', showProgress ? '--progress' : '--quiet', '--force']; if (startPoint) { args.push('-B', ref, startPoint); } @@ -792,9 +792,9 @@ class GitCommandManager { yield this.execGit(args); }); } - checkoutDetach() { + checkoutDetach(showProgress) { return __awaiter(this, void 0, void 0, function* () { - const args = ['checkout', '--detach']; + const args = ['checkout', '--detach', showProgress ? '--progress' : '--quiet']; yield this.execGit(args); }); } @@ -1523,6 +1523,9 @@ function getSource(settings) { // Fetch core.startGroup('Fetching the repository'); const fetchOptions = {}; + if (settings.showProgress) { + fetchOptions.showProgress = true; + } if (settings.filter) { fetchOptions.filter = settings.filter; } @@ -1593,7 +1596,7 @@ function getSource(settings) { } // Checkout core.startGroup('Checking out the ref'); - yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint); + yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint, settings.showProgress); core.endGroup(); // Submodules if (settings.submodules) { diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index f5ba40e..52419d6 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -22,8 +22,8 @@ export interface IGitCommandManager { disableSparseCheckout(): Promise sparseCheckout(sparseCheckout: string[]): Promise sparseCheckoutNonConeMode(sparseCheckout: string[]): Promise - checkout(ref: string, startPoint: string): Promise - checkoutDetach(): Promise + checkout(ref: string, startPoint: string, showProgress?: boolean): Promise + checkoutDetach(showProgress?: boolean): Promise config( configKey: string, configValue: string, @@ -220,8 +220,8 @@ class GitCommandManager { ) } - async checkout(ref: string, startPoint: string): Promise { - const args = ['checkout', '--progress', '--force'] + async checkout(ref: string, startPoint: string, showProgress?: boolean): Promise { + const args = ['checkout', showProgress ? '--progress' : '--quiet', '--force'] if (startPoint) { args.push('-B', ref, startPoint) } else { @@ -231,8 +231,8 @@ class GitCommandManager { await this.execGit(args) } - async checkoutDetach(): Promise { - const args = ['checkout', '--detach'] + async checkoutDetach(showProgress?: boolean): Promise { + const args = ['checkout', '--detach', showProgress ? '--progress' : '--quiet'] await this.execGit(args) } diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index ec87178..948ff4b 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -162,6 +162,10 @@ export async function getSource(settings: IGitSourceSettings): Promise { showProgress?: boolean } = {} + if (settings.showProgress) { + fetchOptions.showProgress = true + } + if (settings.filter) { fetchOptions.filter = settings.filter } else if (settings.sparseCheckout) { @@ -251,7 +255,7 @@ export async function getSource(settings: IGitSourceSettings): Promise { // Checkout core.startGroup('Checking out the ref') - await git.checkout(checkoutInfo.ref, checkoutInfo.startPoint) + await git.checkout(checkoutInfo.ref, checkoutInfo.startPoint, settings.showProgress) core.endGroup() // Submodules