Skip to content

Commit

Permalink
Merge PR if no bundle is added and ci.yaml is updated
Browse files Browse the repository at this point in the history
Due to a Tekton limitation we can't execute a merge task if any previous
tasks have been skipped. This usually happens when not bundle is added
and ci.yaml file is updated. Until tekton enables this workflow I am
temporarily move the merge task into finally section.

The issue has been create in Tekton upstream to fix this issue
tektoncd/pipeline#7680

JIRA: ISV-4476

Signed-off-by: Ales Raszka <[email protected]>
  • Loading branch information
Allda committed Feb 19, 2024
1 parent 66d0517 commit 04959ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,14 +598,15 @@ spec:
subPath: preflight-trigger
workspace: results



finally:
# merge PR
- name: merge-pr
when:
- input: "$(tasks.get-ci-reviewer.results.author_is_reviewer)"
operator: in
values: ["true"]
runAfter:
- evaluate-preflight-result
taskRef:
name: merge-pr
params:
Expand All @@ -626,8 +627,6 @@ spec:
workspace: repository
subPath: src

finally:

- name: set-github-passed-label
when:
- input: "$(tasks.status)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ spec:
image: "$(params.pipeline_image)"
workingDir: $(workspaces.source.path)
script: |
if [ "$force_merge" = "true" ]; then
echo true >$(results.bool_merge.path)
if [ "$(params.force_merge)" = "true" ]; then
echo true > $(results.bool_merge.path)
elif [[ "$(params.bundle_path)" == "" ]]; then
echo true > $(results.bool_merge.path)
else
PKG_PATH=$(dirname $(realpath $(params.bundle_path)))
CI_FILE_PATH="$PKG_PATH/ci.yaml"
Expand Down

0 comments on commit 04959ab

Please sign in to comment.