From 153bc0ba7cbbcbea4d9b19347dd5a3094cdc30b7 Mon Sep 17 00:00:00 2001 From: Max schwenk Date: Wed, 25 Feb 2026 18:15:50 -0500 Subject: [PATCH 1/4] Suppress verbose checkout output with --quiet Replace --progress with --quiet in checkout() and add --quiet to checkoutDetach() to prevent per-file output from flooding CI logs on large repositories. Co-Authored-By: Claude Sonnet 4.6 --- src/git-command-manager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index f5ba40e..8c36cbf 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -221,7 +221,7 @@ class GitCommandManager { } async checkout(ref: string, startPoint: string): Promise { - const args = ['checkout', '--progress', '--force'] + const args = ['checkout', '--quiet', '--force'] if (startPoint) { args.push('-B', ref, startPoint) } else { @@ -232,7 +232,7 @@ class GitCommandManager { } async checkoutDetach(): Promise { - const args = ['checkout', '--detach'] + const args = ['checkout', '--detach', '--quiet'] await this.execGit(args) } From f3b6b37fa6dc69971eae8f36e8212ce2c487a7ba Mon Sep 17 00:00:00 2001 From: Max schwenk Date: Wed, 25 Feb 2026 18:24:10 -0500 Subject: [PATCH 2/4] Thread showProgress through checkout and fix fetch progress flag - Make checkout() and checkoutDetach() accept showProgress so callers can opt into --progress output; default remains --quiet - Pass settings.showProgress to checkout() from git-source-provider - Fix fetchOptions.showProgress not being set (was always undefined) - Rebuild dist Co-Authored-By: Claude Sonnet 4.6 --- dist/index.js | 13 ++++++++----- src/git-command-manager.ts | 12 ++++++------ src/git-source-provider.ts | 6 +++++- 3 files changed, 19 insertions(+), 12 deletions(-) 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 8c36cbf..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', '--quiet', '--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', '--quiet'] + 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 From a5d425690b3051bbfff6251ed2738de4397e5926 Mon Sep 17 00:00:00 2001 From: Max schwenk Date: Wed, 25 Feb 2026 18:39:09 -0500 Subject: [PATCH 3/4] Broaden show-progress description to cover all git operations Co-Authored-By: Claude Sonnet 4.6 --- README.md | 2 +- action.yml | 2 +- src/git-source-settings.ts | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f0f65f9..8597b4c 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ # Default: false fetch-tags: '' - # Whether to show progress status output when fetching. + # Whether to show progress status output for git operations. # Default: true show-progress: '' diff --git a/action.yml b/action.yml index 767c416..802aca0 100644 --- a/action.yml +++ b/action.yml @@ -78,7 +78,7 @@ inputs: description: 'Whether to fetch tags, even if fetch-depth > 0.' default: false show-progress: - description: 'Whether to show progress status output when fetching.' + description: 'Whether to show progress status output for git operations.' default: true lfs: description: 'Whether to download Git-LFS files' diff --git a/src/git-source-settings.ts b/src/git-source-settings.ts index 4e41ac3..2a6c1c3 100644 --- a/src/git-source-settings.ts +++ b/src/git-source-settings.ts @@ -55,7 +55,8 @@ export interface IGitSourceSettings { fetchTags: boolean /** - * Indicates whether to use the --progress option when fetching + * Indicates whether to show progress status output for git operations. + * When false, git commands use --quiet to suppress verbose output. */ showProgress: boolean From 197ee88ce51bbcf96cb50e6cb2739ec03f6fd767 Mon Sep 17 00:00:00 2001 From: Max schwenk Date: Wed, 25 Feb 2026 18:44:33 -0500 Subject: [PATCH 4/4] Make showProgress a required argument for checkout and checkoutDetach Co-Authored-By: Claude Sonnet 4.6 --- dist/index.js | 2 +- src/git-command-manager.ts | 8 ++++---- src/git-directory-helper.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 98aa668..ca0c9d1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1310,7 +1310,7 @@ function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref core.startGroup('Removing previously created refs, to avoid conflicts'); // Checkout detached HEAD if (!(yield git.isDetached())) { - yield git.checkoutDetach(); + yield git.checkoutDetach(false); } // Remove all refs/heads/* let branches = yield git.branchList(false); diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 52419d6..f981004 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, showProgress?: boolean): Promise - checkoutDetach(showProgress?: boolean): Promise + checkout(ref: string, startPoint: string, showProgress: boolean): Promise + checkoutDetach(showProgress: boolean): Promise config( configKey: string, configValue: string, @@ -220,7 +220,7 @@ class GitCommandManager { ) } - async checkout(ref: string, startPoint: string, showProgress?: boolean): Promise { + async checkout(ref: string, startPoint: string, showProgress: boolean): Promise { const args = ['checkout', showProgress ? '--progress' : '--quiet', '--force'] if (startPoint) { args.push('-B', ref, startPoint) @@ -231,7 +231,7 @@ class GitCommandManager { await this.execGit(args) } - async checkoutDetach(showProgress?: boolean): Promise { + async checkoutDetach(showProgress: boolean): Promise { const args = ['checkout', '--detach', showProgress ? '--progress' : '--quiet'] await this.execGit(args) } diff --git a/src/git-directory-helper.ts b/src/git-directory-helper.ts index 9a0085f..cfda43e 100644 --- a/src/git-directory-helper.ts +++ b/src/git-directory-helper.ts @@ -49,7 +49,7 @@ export async function prepareExistingDirectory( core.startGroup('Removing previously created refs, to avoid conflicts') // Checkout detached HEAD if (!(await git.isDetached())) { - await git.checkoutDetach() + await git.checkoutDetach(false) } // Remove all refs/heads/*