From 7543905075fd5531b169a306f369b60d6383b577 Mon Sep 17 00:00:00 2001 From: Usman Date: Fri, 18 Jun 2021 23:34:28 +0200 Subject: [PATCH] Fix copy-paste error on push restriction actors (#824) A duplicated block meant that push restrictions on protected branches could only be applied to teams. This enables users and apps to also be taken into account, as was the intention of #615. --- github/util_v4_branch_protection.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/github/util_v4_branch_protection.go b/github/util_v4_branch_protection.go index 58ed795bd2..e3e2ee1a40 100644 --- a/github/util_v4_branch_protection.go +++ b/github/util_v4_branch_protection.go @@ -190,7 +190,7 @@ func setDismissalActorIDs(actors []DismissalActorTypes) []string { pushActors = append(pushActors, a.Actor.Team.ID.(string)) } if a.Actor.User != (Actor{}) { - pushActors = append(pushActors, a.Actor.Team.ID.(string)) + pushActors = append(pushActors, a.Actor.User.ID.(string)) } } @@ -204,7 +204,10 @@ func setPushActorIDs(actors []PushActorTypes) []string { pushActors = append(pushActors, a.Actor.Team.ID.(string)) } if a.Actor.User != (Actor{}) { - pushActors = append(pushActors, a.Actor.Team.ID.(string)) + pushActors = append(pushActors, a.Actor.User.ID.(string)) + } + if a.Actor.App != (Actor{}) { + pushActors = append(pushActors, a.Actor.App.ID.(string)) } }