Skip to content

Commit 68f7605

Browse files
authored
ROX-32922: Modify trigger logic and tweak annotations (#94)
1 parent 9ab1f55 commit 68f7605

File tree

2 files changed

+40
-7
lines changed

2 files changed

+40
-7
lines changed

.tekton/acs-mcp-server-pull-request.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,23 @@ metadata:
77
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
88
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
99
pipelinesascode.tekton.dev/cancel-in-progress: "true"
10-
pipelinesascode.tekton.dev/max-keep-runs: "3"
11-
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
12-
== "main"
10+
pipelinesascode.tekton.dev/max-keep-runs: "10"
11+
pipelinesascode.tekton.dev/on-label: "[]"
12+
# - body.action != "ready_for_review" prevents double-triggering when a draft PR is marked ready for review.
13+
# - trigger only for PRs on main and release branches.
14+
# - support triggering by label: "konflux-build"
15+
pipelinesascode.tekton.dev/on-cel-expression: |
16+
(
17+
event == "pull_request" && body.action != "ready_for_review" && (
18+
target_branch == "main" ||
19+
target_branch.startsWith("release-") ||
20+
(
21+
has(body.pull_request) &&
22+
has(body.pull_request.labels) &&
23+
body.pull_request.labels.exists(l, l.name == "konflux-build")
24+
)
25+
)
26+
)
1327
labels:
1428
appstudio.openshift.io/application: acs-mcp
1529
appstudio.openshift.io/component: acs-mcp-server

.tekton/acs-mcp-server-push.yaml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,30 @@ metadata:
44
annotations:
55
build.appstudio.openshift.io/repo: https://github.com/stackrox/stackrox-mcp?rev={{revision}}
66
build.appstudio.redhat.com/commit_sha: '{{revision}}'
7+
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
78
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
8-
pipelinesascode.tekton.dev/cancel-in-progress: "false"
9-
pipelinesascode.tekton.dev/max-keep-runs: "3"
10-
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
11-
== "main"
9+
pipelinesascode.tekton.dev/max-keep-runs: "10"
10+
pipelinesascode.tekton.dev/on-label: "[]"
11+
# For push trigger:
12+
# - trigger on commit push on main or release branch.
13+
# - trigger on tag pushes.
14+
# For PR triggers:
15+
# - body.action != "ready_for_review" prevents double-triggering when a draft PR is marked ready for review.
16+
# - trigger only for PRs on release branches.
17+
# - support triggering by label: "konflux-build"
18+
pipelinesascode.tekton.dev/on-cel-expression: |
19+
(
20+
event == "push" && target_branch.matches("^(main|release-.*|refs/tags/.*)$")
21+
) || (
22+
event == "pull_request" && body.action != "ready_for_review" && (
23+
target_branch.startsWith("release-") ||
24+
(
25+
has(body.pull_request) &&
26+
has(body.pull_request.labels) &&
27+
body.pull_request.labels.exists(l, l.name == "konflux-build")
28+
)
29+
)
30+
)
1231
labels:
1332
appstudio.openshift.io/application: acs-mcp
1433
appstudio.openshift.io/component: acs-mcp-server

0 commit comments

Comments
 (0)