Merge pull request #6 from nsarlin-zama/rebase_version_on_main #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/heads | grep -Po '^v\d.\d(.\d)?$' | sort -V | tail -n 1)" >> $GITHUB_ENV | |
- name: Rebase and push | |
run: | | |
git switch $DATA_LATEST_VERSION | |
git rebase master | |
git push --force-with-lease |