checkout/src/git-source-settings.ts
Mostafa Zaher 81a936fd3c Add a quiet input to suppress git output
Adds a `quiet` input (default: false) that passes `--quiet` to the git
commands that fetch and check out the repository: `fetch`, `checkout`,
`checkout --detach`, and `submodule update`.

With `fetch-depth: 0` the refspec covers every branch and tag, so git
prints a `From <url>` line plus one `* [new branch]` / `* [new tag]` line
per ref. On a ref-heavy repository that summary is the bulk of the
checkout log, and `show-progress: false` does not remove it -- that input
only ever controlled `--progress`.

`--quiet` and `--progress` drive different output and compose rather than
conflict: `--progress` forces the transfer/update meter, while `--quiet`
drops the ref summary and other informational messages. `checkout` keeps
its `--progress` when quiet, so a slow checkout still reports progress.

`git lfs fetch` has no `--quiet` flag, so LFS output is unchanged.

Fixes #2409
2026-09-07 23:55:26 +03:00

133 lines
2.4 KiB
TypeScript

export interface IGitSourceSettings {
/**
* The location on disk where the repository will be placed
*/
repositoryPath: string
/**
* The repository owner
*/
repositoryOwner: string
/**
* The repository name
*/
repositoryName: string
/**
* The ref to fetch
*/
ref: string
/**
* The commit to checkout
*/
commit: string
/**
* Indicates whether to clean the repository
*/
clean: boolean
/**
* The filter determining which objects to include
*/
filter: string | undefined
/**
* The array of folders to make the sparse checkout
*/
sparseCheckout: string[]
/**
* Indicates whether to use cone mode in the sparse checkout (if any)
*/
sparseCheckoutConeMode: boolean
/**
* The depth when fetching
*/
fetchDepth: number
/**
* Fetch tags, even if fetchDepth > 0 (default: false)
*/
fetchTags: boolean
/**
* Indicates whether to use the --progress option when fetching
*/
showProgress: boolean
/**
* Indicates whether to use the --quiet option when fetching and checking out
*/
quiet: boolean
/**
* Indicates whether to fetch LFS objects
*/
lfs: boolean
/**
* Indicates whether to checkout submodules
*/
submodules: boolean
/**
* Indicates whether to recursively checkout submodules
*/
nestedSubmodules: boolean
/**
* The auth token to use when fetching the repository
*/
authToken: string
/**
* The SSH key to configure
*/
sshKey: string
/**
* Additional SSH known hosts
*/
sshKnownHosts: string
/**
* Indicates whether the server must be a known host
*/
sshStrict: boolean
/**
* The SSH user to login as
*/
sshUser: string
/**
* Indicates whether to persist the credentials on disk to enable scripting authenticated git commands
*/
persistCredentials: boolean
/**
* Organization ID for the currently running workflow (used for auth settings)
*/
workflowOrganizationId: number | undefined
/**
* Indicates whether to add repositoryPath as safe.directory in git global config
*/
setSafeDirectory: boolean
/**
* User override on the GitHub Server/Host URL that hosts the repository to be cloned
*/
githubServerUrl: string | undefined
/**
* Opt-in to allow checking out fork pull request code from a workflow
* triggered by pull_request_target or workflow_run.
*/
allowUnsafePrCheckout: boolean
}