1
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2026-03-11 15:13:17 +00:00

feat: implement reference-cache for faster checkouts

- Add `reference-cache` input to action.yml
- Introduce `GitCacheHelper` for bare clone cache management
- Prevent race conditions with `proper-lockfile` and atomic directory renames
- Support iterative submodule caching and robust relative URL resolution
- Append to `info/alternates` preserving existing alternate references
- Add fallback to standard clone on submodule cache failure
- Add unit tests for `GitCacheHelper`

Signed-off-by: Michael Wyraz <mw@brick4u.de>
This commit is contained in:
Michael Wyraz 2026-03-05 11:54:42 +01:00
parent 0c366fd6a8
commit 9ddd3f4b35
16 changed files with 2996 additions and 32 deletions

View file

@ -98,6 +98,12 @@ inputs:
github-server-url:
description: The base URL for the GitHub instance that you are trying to clone from, will use environment defaults to fetch from the same instance that the workflow is running from unless specified. Example URLs are https://github.com or https://my-ghes-server.example.com
required: false
reference-cache:
description: >
Path to a local directory used as a reference cache for Git clones. Over time,
this directory will contain bare clones of the checked-out repositories (and their submodules).
Using this significantly reduces network bandwidth and speeds up clones.
required: false
outputs:
ref:
description: 'The branch, tag or SHA that was checked out'