diff --git a/.github/workflows/auto-rebase.yml b/.github/workflows/auto-rebase.yml new file mode 100644 index 000000000..5700864a8 --- /dev/null +++ b/.github/workflows/auto-rebase.yml @@ -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 + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3565742c4..3ef52ef19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0f0092428..776e455de 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -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