Merge pull request #103 from TomAndrews/mr-ci-skip
Generalise ci-skip to merge requests
This commit is contained in:
commit
71f9728ace
|
@ -418,6 +418,12 @@ public class GitLabWebHook implements UnprotectedRootAction {
|
|||
for (org.gitlab.api.models.GitlabMergeRequest mr : mergeRequests) {
|
||||
if (projectRef.endsWith(mr.getSourceBranch()) ||
|
||||
(trigger.getTriggerOpenMergeRequestOnPush().equals("both") && projectRef.endsWith(mr.getTargetBranch()))) {
|
||||
|
||||
if (trigger.getCiSkip() && mr.getDescription().contains("[ci-skip]")) {
|
||||
LOGGER.log(Level.INFO, "Skipping MR " + mr.getTitle() + " due to ci-skip.");
|
||||
continue;
|
||||
}
|
||||
|
||||
LOGGER.log(Level.FINE,
|
||||
"Generating new merge trigger from "
|
||||
+ mr.toString() + "\n source: "
|
||||
|
@ -481,6 +487,10 @@ public class GitLabWebHook implements UnprotectedRootAction {
|
|||
return;
|
||||
}
|
||||
}
|
||||
if(request.getObjectAttribute().getDescription().contains("[ci-skip]")) {
|
||||
LOGGER.log(Level.INFO, "Skipping MR " + request.getObjectAttribute().getTitle() + " due to ci-skip.");
|
||||
return;
|
||||
}
|
||||
|
||||
Authentication old = SecurityContextHolder.getContext().getAuthentication();
|
||||
SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM);
|
||||
|
|
Loading…
Reference in New Issue