Merge f787e7d544c130d1f240b14444b0ce9724a4f6db into 85e6279cec87321a52edac9c87bce653a07cf6c2

This commit is contained in:
Jack Bates 2025-01-16 16:06:59 -05:00 committed by GitHub
commit d610477733
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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'
@ -274,6 +275,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) {