Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/actionpins/actionpins.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ func GetActionPinByRepo(repo string) (ActionPin, bool) {
return pins[0], true
}

// getActionPin returns the pinned reference for the latest version of the repo.
// getLatestActionPinReference returns the pinned reference for the latest version of the repo.
// Returns an empty string if no pin is found.
func getActionPin(repo string) string {
func getLatestActionPinReference(repo string) string {
pins := GetActionPinsByRepo(repo)
if len(pins) == 0 {
return ""
Expand Down Expand Up @@ -317,18 +317,18 @@ func ResolveActionPin(actionRepo, version string, ctx *PinContext) (string, erro
// If ctx is nil, only embedded pins are consulted.
func ResolveLatestActionPin(repo string, ctx *PinContext) string {
if ctx == nil {
return getActionPin(repo)
return getLatestActionPinReference(repo)
}

pins := GetActionPinsByRepo(repo)
if len(pins) == 0 {
return getActionPin(repo)
return getLatestActionPinReference(repo)
}

latestVersion := pins[0].Version
pinnedRef, err := ResolveActionPin(repo, latestVersion, ctx)
if err != nil || pinnedRef == "" {
return getActionPin(repo)
return getLatestActionPinReference(repo)
}
return pinnedRef
}
Loading