Skip to content

Commit

Permalink
chore: rebase the latest release branch on push to main
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarlin-zama committed Oct 8, 2024
1 parent 37d3d19 commit 0083c97
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/rebase_latest_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Auto rebase the latest version branch with main
on:
push:
branches:
- main

jobs:
synchronise_version_branch:
name: Synchronize the latest branch
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get branch for the latest version
run: |
echo "DATA_LATEST_VERSION=\
$(git for-each-ref --format='%(refname:short)' refs/remotes/origin \
| grep -Po '(?<=origin/)v\d.\d(.\d)?$' \
| sort -V | tail -n 1\
)" >> $GITHUB_ENV
- name: Rebase and push
run: |
git switch $DATA_LATEST_VERSION
git rebase main
git push --force-with-lease

0 comments on commit 0083c97

Please sign in to comment.