MCPcopy Create free account
hub / github.com/github/gh-aw / SetActionDescription

Method SetActionDescription

pkg/workflow/action_cache.go:526–546  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
526func (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.

Callers 1

Calls 2

formatActionCacheKeyFunction · 0.85
PrintfMethod · 0.45

Tested by

no test coverage detected