mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-20 17:00:15 +03:00
Compare commits
5 commits
ef113bc2b4
...
d610477733
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d610477733 | ||
![]() |
85e6279cec | ||
![]() |
009b9ae9e4 | ||
![]() |
f787e7d544 | ||
![]() |
d48599a299 |
2 changed files with 18 additions and 0 deletions
|
@ -311,8 +311,17 @@ jobs:
|
|||
git commit -m "generated"
|
||||
git push
|
||||
```
|
||||
|
||||
*NOTE:* The user email is `{user.id}+{user.login}@users.noreply.github.com`. See users API: https://api.github.com/users/github-actions%5Bbot%5D
|
||||
|
||||
# Recommended permissions
|
||||
|
||||
When using the `checkout` action in your GitHub Actions workflow, it is recommended to set the following `GITHUB_TOKEN` permissions to ensure proper functionality, unless alternative auth is provided via the `token` or `ssh-key` inputs:
|
||||
|
||||
```yaml
|
||||
permissions:
|
||||
contents: read
|
||||
```
|
||||
|
||||
# License
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue