pruneStaleActionCacheEntries removes stale gh-aw-actions entries from the action cache whose version does not match the compiler's current version. This prevents actions-lock.json from accumulating entries for old compiler releases that are no longer referenced by any compiled workflow.
(compiler *workflow.Compiler, actionCache *workflow.ActionCache)
| 298 | // This prevents actions-lock.json from accumulating entries for old compiler |
| 299 | // releases that are no longer referenced by any compiled workflow. |
| 300 | func pruneStaleActionCacheEntries(compiler *workflow.Compiler, actionCache *workflow.ActionCache) { |
| 301 | if actionCache == nil { |
| 302 | return |
| 303 | } |
| 304 | |
| 305 | // Determine the effective version: actionTag takes precedence when explicitly |
| 306 | // set (e.g., via --action-tag for testing against a specific release), otherwise |
| 307 | // fall back to the compiler's built-in version from the binary. |
| 308 | version := compiler.GetActionTag() |
| 309 | if version == "" { |
| 310 | version = compiler.GetVersion() |
| 311 | } |
| 312 | |
| 313 | actionCache.PruneStaleGHAWEntries(version, compiler.EffectiveActionsRepo()) |
| 314 | } |
| 315 | |
| 316 | // pruneOrphanedActionCacheEntries removes entries from the action cache that were |
| 317 | // not referenced during the current compilation run. This garbage-collects entries |
no test coverage detected