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

Function TestIsGhAwNativeAction

pkg/cli/update_actions_test.go:739–760  ·  view source on GitHub ↗

TestIsGhAwNativeAction verifies that isGhAwNativeAction correctly identifies gh-aw native action repos and excludes non-native repos.

(t *testing.T)

Source from the content-addressed store, hash-verified

737// TestIsGhAwNativeAction verifies that isGhAwNativeAction correctly identifies gh-aw
738// native action repos and excludes non-native repos.
739func TestIsGhAwNativeAction(t *testing.T) {
740 tests := []struct {
741 repo string
742 want bool
743 }{
744 {"github/gh-aw-actions/setup", true},
745 {"github/gh-aw/actions/setup", true},
746 {"github/gh-aw/actions/setup-cli", true},
747 {"actions/checkout", false},
748 {"actions/setup-node", false},
749 {"docker/login-action", false},
750 {"github/codeql-action/upload-sarif", false},
751 }
752 for _, tt := range tests {
753 t.Run(tt.repo, func(t *testing.T) {
754 got := isGhAwNativeAction(tt.repo)
755 if got != tt.want {
756 t.Errorf("isGhAwNativeAction(%q) = %v, want %v", tt.repo, got, tt.want)
757 }
758 })
759 }
760}
761
762// TestUpdateActions_NeverDowngrades verifies that UpdateActions never replaces an action
763// with an older version. This can happen when an action has tags that were not published

Callers

nothing calls this directly

Calls 3

isGhAwNativeActionFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected