@@ -20,15 +20,15 @@ func TestActionsService_GetActionsPermissions(t *testing.T) {
2020
2121 mux .HandleFunc ("/orgs/o/actions/permissions" , func (w http.ResponseWriter , r * http.Request ) {
2222 testMethod (t , r , "GET" )
23- fmt .Fprint (w , `{"enabled_repositories": "all", "allowed_actions": "all"}` )
23+ fmt .Fprint (w , `{"enabled_repositories": "all", "allowed_actions": "all", "sha_pinning_required": true }` )
2424 })
2525
2626 ctx := t .Context ()
2727 org , _ , err := client .Actions .GetActionsPermissions (ctx , "o" )
2828 if err != nil {
2929 t .Errorf ("Actions.GetActionsPermissions returned error: %v" , err )
3030 }
31- want := & ActionsPermissions {EnabledRepositories : Ptr ("all" ), AllowedActions : Ptr ("all" )}
31+ want := & ActionsPermissions {EnabledRepositories : Ptr ("all" ), AllowedActions : Ptr ("all" ), SHAPinningRequired : Ptr ( true ) }
3232 if ! cmp .Equal (org , want ) {
3333 t .Errorf ("Actions.GetActionsPermissions returned %+v, want %+v" , org , want )
3434 }
@@ -52,7 +52,7 @@ func TestActionsService_UpdateActionsPermissions(t *testing.T) {
5252 t .Parallel ()
5353 client , mux , _ := setup (t )
5454
55- input := & ActionsPermissions {EnabledRepositories : Ptr ("all" ), AllowedActions : Ptr ("selected" )}
55+ input := & ActionsPermissions {EnabledRepositories : Ptr ("all" ), AllowedActions : Ptr ("selected" ), SHAPinningRequired : Ptr ( true ) }
5656
5757 mux .HandleFunc ("/orgs/o/actions/permissions" , func (w http.ResponseWriter , r * http.Request ) {
5858 v := new (ActionsPermissions )
@@ -63,7 +63,7 @@ func TestActionsService_UpdateActionsPermissions(t *testing.T) {
6363 t .Errorf ("Request body = %+v, want %+v" , v , input )
6464 }
6565
66- fmt .Fprint (w , `{"enabled_repositories": "all", "allowed_actions": "selected"}` )
66+ fmt .Fprint (w , `{"enabled_repositories": "all", "allowed_actions": "selected", "sha_pinning_required": true }` )
6767 })
6868
6969 ctx := t .Context ()
@@ -72,7 +72,7 @@ func TestActionsService_UpdateActionsPermissions(t *testing.T) {
7272 t .Errorf ("Actions.UpdateActionsPermissions returned error: %v" , err )
7373 }
7474
75- want := & ActionsPermissions {EnabledRepositories : Ptr ("all" ), AllowedActions : Ptr ("selected" )}
75+ want := & ActionsPermissions {EnabledRepositories : Ptr ("all" ), AllowedActions : Ptr ("selected" ), SHAPinningRequired : Ptr ( true ) }
7676 if ! cmp .Equal (org , want ) {
7777 t .Errorf ("Actions.UpdateActionsPermissions returned %+v, want %+v" , org , want )
7878 }
@@ -326,12 +326,14 @@ func TestActionsPermissions_Marshal(t *testing.T) {
326326 EnabledRepositories : Ptr ("e" ),
327327 AllowedActions : Ptr ("a" ),
328328 SelectedActionsURL : Ptr ("sau" ),
329+ SHAPinningRequired : Ptr (true ),
329330 }
330331
331332 want := `{
332333 "enabled_repositories": "e",
333334 "allowed_actions": "a",
334- "selected_actions_url": "sau"
335+ "selected_actions_url": "sau",
336+ "sha_pinning_required": true
335337 }`
336338
337339 testJSONMarshal (t , u , want )
0 commit comments