Skip to content

Commit

Permalink
Fix copy-paste error on push restriction actors
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 committed Jun 17, 2021
1 parent b9b5aa1 commit ebbb806
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 ebbb806

Please sign in to comment.