Skip to content

Commit a8a7e67

Browse files
committed
fix: Merge task fails with automerge
Due to what seems to be like a bug in github CLI or directly in Github the --auto is now replaced with --admin. The auto flag sometimes raised a Graphql error from which it was hard to tell what's wrong. The issue was pretty non-deterministic and pretty much failed randomly. A local testing didn't prove the issue on our site. This issue was most likely introduced by start using the Github CLI utility. Previously the merge was done using direct API calls to REST. The current CLI tool uses GraphQL. At the point when pipelines wants to merge the PR we already know whether a test passed or failed so it is safe to use --admin and merge the PR immediately. JIRA: ISV-6111 Signed-off-by: Ales Raszka <araszka@redhat.com>
1 parent 20bca90 commit a8a7e67

File tree

1 file changed

+1
-1
lines changed
  • ansible/roles/operator-pipeline/templates/openshift/tasks

1 file changed

+1
-1
lines changed

ansible/roles/operator-pipeline/templates/openshift/tasks/merge-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ spec:
8080
8181
# Squash and merge only if the head commit sha has not changed since
8282
# the start of the pipeline run
83-
MERGE_STDERR=$(gh pr merge "$(params.git_pr_url)" --squash --auto --match-head-commit "$(params.git_head_commit)" 2>&1 >/dev/null)
83+
MERGE_STDERR=$(gh pr merge "$(params.git_pr_url)" --squash --admin --match-head-commit "$(params.git_head_commit)" 2>&1 >/dev/null)
8484
MERGE_RESULT=$?
8585
MERGE_ERROR=$(echo "$MERGE_STDERR" | grep -oP '(?<=GraphQL: ).*')
8686

0 commit comments

Comments
 (0)