Skip to content

Commit 15ccff4

Browse files
authored
only fail access policy for specific command and proceed with the rest (#500)
* only fail access policy for specific command and proceed with the rest - improve policy violation message
1 parent e8aa565 commit 15ccff4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/digger/digger.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ func RunCommandsPerProject(
9999
}
100100

101101
if !allowedToPerformCommand {
102-
msg := fmt.Sprintf("User %s is not allowed to perform action: %s. Check your policies", requestedBy, command)
103-
err := reporter.Report(msg, utils.AsCollapsibleComment("Policy violation"))
102+
msg := fmt.Sprintf("User %s is not allowed to perform action: %s. Check your policies :x:", requestedBy, command)
103+
err := reporter.Report(msg, utils.AsCollapsibleComment(fmt.Sprintf("Policy violation for <b>%v - %v</b>", projectCommands.ProjectName, command)))
104104
if err != nil {
105105
log.Printf("Error publishing comment: %v", err)
106106
}
107+
log.Printf("Skipping command ... %v for project %v", command, projectCommands.ProjectName)
107108
log.Println(msg)
108-
return false, false, errors.New(msg)
109+
continue
109110
}
110111

111112
projectLock := &locking.PullRequestLock{

0 commit comments

Comments
 (0)