-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: rebase the latest release branch on push to main
- Loading branch information
1 parent
37d3d19
commit 0083c97
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
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
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 |