mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-08-14 17:30:50 +00:00
Merge 45abae3e9f
into ff7abcd0c3
This commit is contained in:
commit
6452e1970f
10 changed files with 446 additions and 27 deletions
21
README.md
21
README.md
|
@ -104,6 +104,12 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
|
|||
# Default: true
|
||||
clean: ''
|
||||
|
||||
# Whether to preserve local changes during checkout. If true, tries to preserve
|
||||
# local files that are not tracked by Git. By default, all files will be
|
||||
# overwritten.
|
||||
# Default: false
|
||||
preserve-local-changes: ''
|
||||
|
||||
# Partially clone against a given filter. Overrides sparse-checkout if set.
|
||||
# Default: null
|
||||
filter: ''
|
||||
|
@ -349,6 +355,21 @@ jobs:
|
|||
|
||||
*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
|
||||
|
||||
## Preserve local changes during checkout
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: Create file before checkout
|
||||
shell: pwsh
|
||||
run: New-Item -Path . -Name "example.txt" -ItemType "File"
|
||||
|
||||
- name: Checkout with preserving local changes
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
clean: false
|
||||
preserve-local-changes: true
|
||||
```
|
||||
|
||||
# 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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue