Skip to content

Commit 623bd5a

Browse files
Copilotpelikhan
andauthored
refactor: make repo pin sort mutation explicit
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 330b1e5 commit 623bd5a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/actionpins/actionpins.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ func buildByRepoIndex(pins []ActionPin) map[string][]ActionPin {
176176
for _, pin := range pins {
177177
byRepo[pin.Repo] = append(byRepo[pin.Repo], pin)
178178
}
179-
for _, repoPins := range byRepo {
180-
slices.SortFunc(repoPins, func(a, b ActionPin) int {
179+
for key := range byRepo {
180+
slices.SortFunc(byRepo[key], func(a, b ActionPin) int {
181181
v1 := strings.TrimPrefix(a.Version, "v")
182182
v2 := strings.TrimPrefix(b.Version, "v")
183183
return semverutil.Compare(v2, v1) // descending by semver

0 commit comments

Comments
 (0)