diff --git a/pkg/workflow/action_pins_test.go b/pkg/workflow/action_pins_test.go index b7bfe74af25..53462f4fb77 100644 --- a/pkg/workflow/action_pins_test.go +++ b/pkg/workflow/action_pins_test.go @@ -533,61 +533,6 @@ func TestApplyActionPinToTypedStep_Immutability(t *testing.T) { } } -// TestGetActionPinSemverPreference verifies that when multiple versions exist for the same repo, -// the latest version by semver is returned -func TestGetActionPinSemverPreference(t *testing.T) { - tests := []struct { - name string - repo string - expectedVersion string - }{ - { - name: "setup-go prefers v6.2.0 over v6", - repo: "actions/setup-go", - expectedVersion: "v6.2.0", - }, - { - name: "setup-node prefers v6.2.0 over v6", - repo: "actions/setup-node", - expectedVersion: "v6.2.0", - }, - { - name: "upload-artifact prefers v6.0.0 over v5 and v4", - repo: "actions/upload-artifact", - expectedVersion: "v6.0.0", - }, - { - name: "setup-python prefers v5.6.0 over v5", - repo: "actions/setup-python", - expectedVersion: "v5.6.0", - }, - { - name: "cache prefers v4.3.0 over v4", - repo: "actions/cache", - expectedVersion: "v4.3.0", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // Test GetActionPin - result := GetActionPin(tt.repo) - if !strings.Contains(result, "# "+tt.expectedVersion) { - t.Errorf("GetActionPin(%s) = %s, expected version %s", tt.repo, result, tt.expectedVersion) - } - - // Test GetActionPinByRepo - pin, exists := GetActionPinByRepo(tt.repo) - if !exists { - t.Fatalf("GetActionPinByRepo(%s) returned false, expected true", tt.repo) - } - if pin.Version != tt.expectedVersion { - t.Errorf("GetActionPinByRepo(%s).Version = %s, expected %s", tt.repo, pin.Version, tt.expectedVersion) - } - }) - } -} - // TestGetActionPinWithData_SemverPreference tests that GetActionPinWithData // resolves actions using the exact version tag specified, and only falls back // to compatible versions when the exact tag doesn't exist in hardcoded pins