Skip to content

Commit

Permalink
Fix copy-paste error on push restriction actors (integrations#824)
Browse files Browse the repository at this point in the history
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 integrations#615.
  • Loading branch information
usmonster authored Jun 18, 2021
1 parent e82a275 commit 7543905
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions github/util_v4_branch_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand All @@ -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))
}
}

Expand Down

0 comments on commit 7543905

Please sign in to comment.