SetInputs stores the action inputs in the cache entry for the given repo and version. If no cache entry exists for the key, a new entry is created with an empty SHA so that inputs fetched from the network are persisted even before the SHA is resolved.
(repo, version string, inputs map[string]*ActionYAMLInput)
| 492 | // If no cache entry exists for the key, a new entry is created with an empty SHA so that |
| 493 | // inputs fetched from the network are persisted even before the SHA is resolved. |
| 494 | func (c *ActionCache) SetInputs(repo, version string, inputs map[string]*ActionYAMLInput) { |
| 495 | key := formatActionCacheKey(repo, version) |
| 496 | entry, exists := c.Entries[key] |
| 497 | if !exists { |
| 498 | actionCacheLog.Printf("No cache entry for key=%s, creating new entry to store inputs", key) |
| 499 | entry = ActionCacheEntry{ |
| 500 | Repo: repo, |
| 501 | Version: version, |
| 502 | } |
| 503 | } |
| 504 | entry.Inputs = inputs |
| 505 | c.Entries[key] = entry |
| 506 | c.dirty = true |
| 507 | actionCacheLog.Printf("Cached inputs for key=%s, inputs=%d", key, len(inputs)) |
| 508 | } |
| 509 | |
| 510 | // GetActionDescription retrieves the cached action description for the given repo and version. |
| 511 | // Returns the description and true if a non-empty description is cached, otherwise "" and false. |