SetActionDescription stores the action description in the cache entry for the given repo and version. If no cache entry exists for the key, a new entry is created. Empty descriptions are not stored; actions without a description string are treated the same as actions whose description has not yet be
(repo, version, description string)
| 524 | // actions whose description has not yet been fetched, so we avoid caching an empty string that |
| 525 | // would prevent a later fetch from populating the field. |
| 526 | func (c *ActionCache) SetActionDescription(repo, version, description string) { |
| 527 | if description == "" { |
| 528 | // Skip persisting empty descriptions; callers that want to distinguish |
| 529 | // "no description fetched" from "action has no description" should use |
| 530 | // a sentinel value. For our use case (action.yml display text), omitting |
| 531 | // empty values is intentional to keep the cache file tidy. |
| 532 | return |
| 533 | } |
| 534 | key := formatActionCacheKey(repo, version) |
| 535 | entry, exists := c.Entries[key] |
| 536 | if !exists { |
| 537 | entry = ActionCacheEntry{ |
| 538 | Repo: repo, |
| 539 | Version: version, |
| 540 | } |
| 541 | } |
| 542 | entry.ActionDescription = description |
| 543 | c.Entries[key] = entry |
| 544 | c.dirty = true |
| 545 | actionCacheLog.Printf("Cached description for key=%s", key) |
| 546 | } |
| 547 | |
| 548 | // GetReleasedAt retrieves the cached release date for the given repo and version. |
| 549 | // Returns the time and true if a release date is cached, otherwise zero time and false. |
no test coverage detected