mirror of
https://github.com/actions/checkout.git
synced 2025-06-08 00:39:04 +00:00
feat(git config): Set default user.name and user.email in git config
This commit is contained in:
parent
cbb722410c
commit
f3b199b7ed
6 changed files with 26 additions and 4 deletions
|
@ -274,6 +274,14 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
|||
settings.commit,
|
||||
settings.githubServerUrl
|
||||
)
|
||||
if (settings.configureUser) {
|
||||
if (!await git.configExists('user.name', true)) {
|
||||
await git.config('user.name', 'github-action[bot]', true)
|
||||
}
|
||||
if (!await git.configExists('user.email', true)) {
|
||||
await git.config('user.email', '41898282+github-actions[bot]@users.noreply.github.com', true)
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
// Remove auth
|
||||
if (authHelper) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue