diff --git a/.buildkite/hooks/post-checkout b/.buildkite/hooks/post-checkout deleted file mode 100755 index b157290266..0000000000 --- a/.buildkite/hooks/post-checkout +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -checkout_merge() { - local target_branch=$1 - local pr_commit=$2 - local merge_branch=$3 - - if [[ -z "${target_branch}" ]]; then - echo "No pull request target branch" - exit 1 - fi - - git fetch -v origin "${target_branch}" - git checkout FETCH_HEAD - echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" - - # create temporal branch to merge the PR with the target branch - git checkout -b ${merge_branch} - echo "New branch created: $(git rev-parse --abbrev-ref HEAD)" - - # set author identity so it can be run git merge - git config user.name "github-merged-pr-post-checkout" - git config user.email "auto-merge@buildkite" - - git merge --no-edit "${BUILDKITE_COMMIT}" || { - local merge_result=$? - echo "Merge failed: ${merge_result}" - git merge --abort - exit ${merge_result} - } -} - -pull_request="${BUILDKITE_PULL_REQUEST:-false}" - -if [[ "${pull_request}" == "false" ]]; then - echo "Not a pull request, skipping" - exit 0 -fi - -TARGET_BRANCH="${BUILDKITE_PULL_REQUEST_BASE_BRANCH:-master}" -PR_COMMIT="${BUILDKITE_COMMIT}" -PR_ID=${BUILDKITE_PULL_REQUEST} -MERGE_BRANCH="pr_merge_${PR_ID}" - -checkout_merge "${TARGET_BRANCH}" "${PR_COMMIT}" "${MERGE_BRANCH}" - -echo "Commit information" - -git --no-pager log --format=%B -n 1 - -# Ensure buildkite groups are rendered -echo "" diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index a1e506227e..fa74eb95f8 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -11,6 +11,7 @@ "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", "skip_ci_on_only_changed": [ "^.ci/", "^.github/", "catalog-info.yaml", "^.pre-commit-config.yaml", "^.mergify.yml", "\\.md$", "^changelog/", "^docs/"], + "use_merge_commit": true, "fail_on_not_mergeable": true }, { @@ -24,6 +25,7 @@ "build_on_comment": true, "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:package)\\W+(?:this|it))|^/package$", "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:package)\\W+(?:this|it))|^/package$", + "use_merge_commit": true, "fail_on_not_mergeable": true }, { @@ -37,6 +39,7 @@ "build_on_comment": true, "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:run)\\W+(?:perf-tests))|^/perf-tests$", "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:run)\\W+(?:perf-tests))|^/perf-tests$", + "use_merge_commit": true, "fail_on_not_mergeable": true } ]