From 2701a9fadf7db5fad1ebb7193092649cbdbecefb Mon Sep 17 00:00:00 2001 From: Alexander Droste Date: Fri, 29 May 2026 11:16:50 +0100 Subject: [PATCH 1/2] feat: auto-cherry pick commits into current release branch Signed-off-by: Alexander Droste --- .github/workflows/CherryPick.yml | 55 ++++++++++++++++++++++++++++++++ README.md | 6 ++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/CherryPick.yml diff --git a/.github/workflows/CherryPick.yml b/.github/workflows/CherryPick.yml new file mode 100644 index 0000000..8d4bd2d --- /dev/null +++ b/.github/workflows/CherryPick.yml @@ -0,0 +1,55 @@ +# Cherry-pick workflow +# +# Automatically cherry-picks merged commits into the current release branch. +# +# To update the release branch, change RELEASE_BRANCH below. + +name: Cherry-pick + +on: + pull_request_target: + branches: [ "main" ] + types: [ closed ] + +env: + RELEASE_BRANCH: v1.5-variegata + +jobs: + cherry-pick: + name: Cherry-pick merged PR + if: ${{ github.event.pull_request.merged == true }} + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + steps: + - name: Checkout target branch + uses: actions/checkout@v6 + with: + ref: ${{ env.RELEASE_BRANCH }} + fetch-depth: 0 + token: ${{ secrets.CHERRY_PICK_TOKEN || github.token }} + + - name: Cherry-pick squash commit + id: cherry-pick + env: + MERGE_COMMIT_SHA: ${{ github.event.pull_request.merge_commit_sha }} + run: | + set -euo pipefail + + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR_ID+$GITHUB_ACTOR@users.noreply.github.com" + + git fetch origin main + git cherry-pick -x "$MERGE_COMMIT_SHA" + git push origin "HEAD:$RELEASE_BRANCH" + + - name: Notify on failure + if: ${{ failure() }} + env: + GH_TOKEN: ${{ secrets.CHERRY_PICK_TOKEN || github.token }} + PR_NUMBER: ${{ github.event.pull_request.number }} + MERGED_BY: ${{ github.event.pull_request.merged_by.login }} + run: | + gh pr comment "$PR_NUMBER" \ + --body "@${MERGED_BY} Cherry-pick to \`$RELEASE_BRANCH\` failed. Please cherry-pick manually." diff --git a/README.md b/README.md index 33adc58..29e5b6d 100644 --- a/README.md +++ b/README.md @@ -152,3 +152,9 @@ lldb -- ./build/debug/duckdb -unsigned ```sh ~/duckdb-vortex make EXT_FLAGS='-DUSE_SHARED_VORTEX=1' reldebug -j ``` + +## Cherry-pick workflow + +When a PR is merged to `main`, the cherry-pick workflow automatically applies the squash commit to the current release branch. + +The current release branch is configured in `.github/workflows/CherryPick.yml` via the `RELEASE_BRANCH` env var. From f395bd50d855ae329d9099edd814da89bc0bf928 Mon Sep 17 00:00:00 2001 From: Alexander Droste Date: Fri, 29 May 2026 11:51:31 +0100 Subject: [PATCH 2/2] fix Signed-off-by: Alexander Droste --- .github/workflows/CherryPick.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CherryPick.yml b/.github/workflows/CherryPick.yml index 8d4bd2d..4c15148 100644 --- a/.github/workflows/CherryPick.yml +++ b/.github/workflows/CherryPick.yml @@ -24,11 +24,11 @@ jobs: issues: write steps: - name: Checkout target branch - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: ref: ${{ env.RELEASE_BRANCH }} fetch-depth: 0 - token: ${{ secrets.CHERRY_PICK_TOKEN || github.token }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Cherry-pick squash commit id: cherry-pick @@ -47,7 +47,7 @@ jobs: - name: Notify on failure if: ${{ failure() }} env: - GH_TOKEN: ${{ secrets.CHERRY_PICK_TOKEN || github.token }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.pull_request.number }} MERGED_BY: ${{ github.event.pull_request.merged_by.login }} run: |