Compare commits

...

4 Commits

Author SHA1 Message Date
Jack Bates
ef113bc2b4
Merge f787e7d544c130d1f240b14444b0ce9724a4f6db into cbb722410c2e876e24abbe8de2cc27693e501dcb 2024-11-14 12:19:14 -05:00
Mohammad Ismail
cbb722410c
Update README.md (#1977)
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Licensed / Check licenses (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / test (macos-latest) (push) Has been cancelled
Build and Test / test (ubuntu-latest) (push) Has been cancelled
Build and Test / test (windows-latest) (push) Has been cancelled
Build and Test / test-proxy (push) Has been cancelled
Build and Test / test-bypass-proxy (push) Has been cancelled
Build and Test / test-git-container (push) Has been cancelled
Build and Test / test-output (push) Has been cancelled
2024-11-14 10:41:00 -05:00
Jack Bates
f787e7d544
Apply suggestions from code review
Co-authored-by: Usman <akeju00+github@gmail.com>
2023-10-06 06:25:44 -07:00
Jack Bates
d48599a299
Set default user.name and user.email 2021-09-15 09:59:02 -07:00
2 changed files with 11 additions and 2 deletions

View File

@ -212,7 +212,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
repository: my-org/my-tools repository: my-org/my-tools
path: my-tools path: my-tools
``` ```
> - If your secondary repository is private you will need to add the option noted in [Checkout multiple repos (private)](#Checkout-multiple-repos-private) > - If your secondary repository is private or internal you will need to add the option noted in [Checkout multiple repos (private)](#Checkout-multiple-repos-private)
## Checkout multiple repos (nested) ## Checkout multiple repos (nested)
@ -226,7 +226,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
repository: my-org/my-tools repository: my-org/my-tools
path: my-tools path: my-tools
``` ```
> - If your secondary repository is private you will need to add the option noted in [Checkout multiple repos (private)](#Checkout-multiple-repos-private) > - If your secondary repository is private or internal you will need to add the option noted in [Checkout multiple repos (private)](#Checkout-multiple-repos-private)
## Checkout multiple repos (private) ## Checkout multiple repos (private)

View File

@ -1,4 +1,5 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import * as github from '@actions/github'
import * as fsHelper from './fs-helper' import * as fsHelper from './fs-helper'
import * as gitAuthHelper from './git-auth-helper' import * as gitAuthHelper from './git-auth-helper'
import * as gitCommandManager from './git-command-manager' import * as gitCommandManager from './git-command-manager'
@ -274,6 +275,14 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
settings.commit, settings.commit,
settings.githubServerUrl settings.githubServerUrl
) )
// Set default author
if (!await git.configExists('user.name', true)) {
await git.config('user.name', github.context.workflow, true)
}
if (!await git.configExists('user.email', true)) {
await git.config('user.email', 'github-actions@github.com', true)
}
} finally { } finally {
// Remove auth // Remove auth
if (authHelper) { if (authHelper) {