0
1
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
Jack Bates 5589ee8caa
Merge f787e7d544 into cd7d8d697e 2024-03-16 01:21:23 -07: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
1 changed files with 9 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import * as core from '@actions/core'
import * as github from '@actions/github'
import * as fsHelper from './fs-helper'
import * as gitAuthHelper from './git-auth-helper'
import * as gitCommandManager from './git-command-manager'
@ -273,6 +274,14 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
settings.commit,
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 {
// Remove auth
if (authHelper) {