You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ifsourceBranch, ok:=pr.GetAnnotations()[keys.SourceBranch]; ok {
104
-
// NOTE(chmouel): Every PR has their own branch and so is every push to different branch
105
-
// it means we only cancel pipelinerun of the same name that runs to
106
-
// the unique branch. Note: HeadBranch is the branch from where the PR
107
-
// comes from in git jargon.
108
-
ifsourceBranch!=p.event.HeadBranch {
109
-
p.logger.Infof("cancel-in-progress: skipping pipelinerun %v/%v as it is not from the same branch, annotation source-branch: %s event headbranch: %s", pr.GetNamespace(), pr.GetName(), sourceBranch, p.event.HeadBranch)
110
-
returnfalse
111
-
}
88
+
labelSelector:=getLabelSelector(labelMap)
89
+
p.run.Clients.Log.Infof("cancel-in-progress: selecting pipelineRuns to cancel with labels: %v", labelSelector)
ifsourceBranch, ok:=pr.GetAnnotations()[keys.SourceBranch]; ok {
100
+
// NOTE(chmouel): Every PR has their own branch and so is every push to different branch
101
+
// it means we only cancel pipelinerun of the same name that runs to
102
+
// the unique branch. Note: HeadBranch is the branch from where the PR
103
+
// comes from in git jargon.
104
+
ifsourceBranch!=p.event.HeadBranch {
105
+
p.logger.Infof("cancel-in-progress: skipping pipelinerun %v/%v as it is not from the same branch, annotation source-branch: %s event headbranch: %s", pr.GetNamespace(), pr.GetName(), sourceBranch, p.event.HeadBranch)
106
+
returnfalse
112
107
}
108
+
}
113
109
114
-
returnpr.GetName() !=matchPR.GetName()
115
-
})
110
+
returnpr.GetName() !=matchPR.GetName()
111
+
})
112
+
returnnil
116
113
}
117
114
118
115
// cancelPipelineRunsOpsComment cancels all PipelineRuns associated with a given repository and pull request.
0 commit comments