Add objectFormat setting to allow init()ing a repo with sha256

This commit is contained in:
Yang Zhao 2024-08-23 00:23:06 -07:00
parent 85e6279cec
commit b9de40a228
9 changed files with 81 additions and 8 deletions

View file

@ -126,6 +126,11 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
# running from unless specified. Example URLs are https://github.com or
# https://my-ghes-server.example.com
github-server-url: ''
# Use the given object format when creating local repository. Specifically, use
# 'sha256' to checkout a SHA-256 repository.
# Default: null
object-format: ''
```
<!-- end usage -->
@ -144,6 +149,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
- [Checkout pull request on closed event](#Checkout-pull-request-on-closed-event)
- [Push a commit using the built-in token](#Push-a-commit-using-the-built-in-token)
- [Push a commit to a PR using the built-in token](#Push-a-commit-to-a-PR-using-the-built-in-token)
- [Checkout SHA-256 repository](#checkout-sha-256-repository)
## Fetch only the root files
@ -323,6 +329,14 @@ permissions:
contents: read
```
## Checkout SHA-256 repository
```yaml
- uses: actions/checkout@v4
with:
object-format: sha256
```
# License
The scripts and documentation in this project are released under the [MIT License](LICENSE)