mirror of
https://gitea.com/actions/checkout.git
synced 2025-04-20 15:55:39 +08:00
Merge f787e7d544c130d1f240b14444b0ce9724a4f6db into b80ff79f1755d06ba70441c368a6fe801f5f3a62
This commit is contained in:
commit
6cfeda9625
@ -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'
|
||||||
@ -273,6 +274,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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user