Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/auto-rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Auto Rebase Work Branches

on:
push:
branches:
- main
- "4.1"
- "3.1"
- "3.2"
- "2.4"
workflow_dispatch:

jobs:
auto-rebase:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
mapping:
- base: main
branch: wip/4.2
- base: 4.1
branch: wip/4.1
- base: 3.1
branch: wip/3.1
- base: 3.2
branch: wip/3.2
- base: 2.4
branch: wip/2.4

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install GitHub CLI
uses: cli/cli-action@v2

- name: Set up Git
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"

- name: Fetch branches
run: |
git fetch origin ${ {matrix.mapping.base} }
git fetch origin ${ {matrix.mapping.branch} }

- name: Rebase work branch on base branch
run: |
BASE=${{ matrix.mapping.base }}
BRANCH=${{ matrix.mapping.branch }}

echo "Rebasing $BRANCH onto $BASE"

git checkout $BRANCH
git rebase origin/$BASE || {
echo "Rebase conflict detected on $BRANCH. Aborting."
git rebase --abort
exit 1
}

- name: Push rebased branch
run: |
BRANCH=${{ matrix.mapping.branch }}
echo "Pushing updated branch: $BRANCH"
git push --force-with-lease origin $BRANCH

6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- 5432:5432
steps:
- name: Checkout ${{ inputs.branch }}
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: ${{ inputs.branch }}
- name: Get year/month for cache key
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
db: [ 'MariaDB', 'MySQL', 'PostgreSQL', 'MSSQLServer', 'CockroachDB', 'Db2', 'Oracle' ]
steps:
- name: Checkout ${{ inputs.branch }}
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: ${{ inputs.branch }}
- name: Get year/month for cache key
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
- { name: "26-ea", java_version_numeric: 26, from: 'jdk.java.net', jvm_args: '--enable-preview' }
steps:
- name: Checkout ${{ inputs.branch }}
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: ${{ inputs.branch }}
- name: Get year/month for cache key
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Setup Java
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
Expand Down
Loading