feat: add cache.offline_mode to reuse cached actions (#966)

Co-authored-by: silverwind <[email protected]>
Co-authored-by: silverwind <[email protected]>
Co-authored-by: TKaxv_7S <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: TKaxv_7S <[email protected]>
Co-authored-by: TKaxv_7S <[email protected]>
Reviewed-on: https://gitea.com/gitea/runner/pulls/966
Reviewed-by: Nicolas <[email protected]>
Reviewed-by: silverwind <[email protected]>
Co-authored-by: Vi <[email protected]>
Co-committed-by: Vi <[email protected]>
This commit is contained in:
authored and silverwind committed 2026-05-20 14:09:39 +00:00
1 parent fab9714f9a
commit 2208e7ec63
6 files changed
+108 -46

No files matched your search

+3
View File
@@ -102,6 +102,9 @@ cache:
# (or `gitea-runner cache-server`) is in use: the runner pre-registers each job's ACTIONS_RUNTIME_TOKEN with the
# cache-server, and the cache-server enforces bearer auth + per-repo cache isolation.
external_secret: ""
# When true, reuse a cached action instead of fetching from the remote on every job. Note: a moved tag
# (e.g. a re-tagged "v6") or an updated branch stays at the cached commit until its cache entry is removed.
offline_mode: false
container:
# Specifies the network to which the container will connect.
+1
View File
@@ -52,6 +52,7 @@ type Cache struct {
Port uint16 `yaml:"port"` // Port specifies the caching port.
ExternalServer string `yaml:"external_server"` // ExternalServer specifies the URL of external cache server
ExternalSecret string `yaml:"external_secret"` // ExternalSecret is a shared secret between this runner and an external gitea-runner cache-server, enabling per-job ACTIONS_RUNTIME_TOKEN authentication and repo scoping over the network. Leave empty to keep the legacy unauthenticated behavior.
OfflineMode bool `yaml:"offline_mode"` // OfflineMode reuses a cached action without fetching from the remote; a moved tag or branch stays at the cached commit until the cache entry is removed.
}
// Container represents the configuration for the container.