mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-28 23:08:26 +00:00
chore: adding more detailed logs for policy approval (#5178)
Signed-off-by: lee2sh <lee.sh9233@gmail.com>
This commit is contained in:
@@ -405,6 +405,9 @@ func (p *DefaultProjectCommandRunner) doApprovePolicies(ctx command.ProjectConte
|
||||
} else {
|
||||
prjPolicyStatus[i].Approvals = 0
|
||||
}
|
||||
// User matches the author and prevent self approve is set to true
|
||||
} else if isOwner && !ignorePolicy && ctx.User.Username == ctx.Pull.Author && policySet.PreventSelfApprove {
|
||||
prjErr = multierror.Append(prjErr, fmt.Errorf("policy set: %s the author of pr %s matches the command commenter user %s - please contact another policy owners to approve failing policies", policySet.Name, ctx.Pull.Author, ctx.User.Username))
|
||||
// User is not authorized to approve policy set.
|
||||
} else if !ignorePolicy {
|
||||
prjErr = multierror.Append(prjErr, fmt.Errorf("policy set: %s user %s is not a policy owner - please contact policy owners to approve failing policies", policySet.Name, ctx.User.Username))
|
||||
|
||||
Reference in New Issue
Block a user