( ctx context.Context, skillRef string, allowMajor, verbose bool, coolDown time.Duration, resolver skillRefUpdateResolver, )
| 756 | } |
| 757 | |
| 758 | func updateSkillRefValue( |
| 759 | ctx context.Context, |
| 760 | skillRef string, |
| 761 | allowMajor, verbose bool, |
| 762 | coolDown time.Duration, |
| 763 | resolver skillRefUpdateResolver, |
| 764 | ) (bool, string, error) { |
| 765 | trimmedSkillRef := strings.TrimSpace(skillRef) |
| 766 | if trimmedSkillRef == "" || strings.Contains(trimmedSkillRef, "${{") { |
| 767 | return false, skillRef, nil |
| 768 | } |
| 769 | spec, currentRef, ok := strings.Cut(trimmedSkillRef, "@") |
| 770 | spec = strings.TrimSpace(spec) |
| 771 | currentRef = strings.TrimSpace(currentRef) |
| 772 | if !ok || spec == "" || currentRef == "" { |
| 773 | return false, skillRef, nil |
| 774 | } |
| 775 | |
| 776 | repo := gitutil.ExtractBaseRepo(spec) |
| 777 | if repo == "" { |
| 778 | return false, skillRef, nil |
| 779 | } |
| 780 | latestRef, err := resolver(ctx, repo, currentRef, allowMajor, verbose, coolDown) |
| 781 | if err != nil { |
| 782 | if verbose { |
| 783 | updateLog.Printf("Skipping skill update for %s@%s: %v", spec, currentRef, err) |
| 784 | } |
| 785 | return false, skillRef, nil |
| 786 | } |
| 787 | if latestRef == "" || latestRef == currentRef { |
| 788 | return false, skillRef, nil |
| 789 | } |
| 790 | return true, spec + "@" + latestRef, nil |
| 791 | } |
| 792 | |
| 793 | func updateActionRefsInContentWithDeps(ctx context.Context, deps actionUpdateDeps, content string, cache map[string]latestReleaseResult, coolDownCache map[string]coolDownCheckResult, allowMajor, verbose bool, coolDown time.Duration) (bool, string, error) { |
| 794 | changed := false |
no test coverage detected