mirror of
https://github.com/actions/checkout.git
synced 2025-11-28 01:51:57 +02:00
Merge 45abae3e9f into c2d88d3ecc
This commit is contained in:
commit
769a0449fb
10 changed files with 446 additions and 27 deletions
21
README.md
21
README.md
|
|
@ -111,6 +111,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: ''
|
||||
|
|
@ -356,6 +362,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