From ebbb806c166b0beb3619bfbd015b93ddfdbba339 Mon Sep 17 00:00:00 2001 From: Usman Akeju Date: Thu, 17 Jun 2021 20:41:35 +0200 Subject: [PATCH] Fix copy-paste error on push restriction actors 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)) } }