workflow: use rebase instead of merge
All checks were successful
Update Nix Flake / update-flake (push) Successful in 1m24s
All checks were successful
Update Nix Flake / update-flake (push) Successful in 1m24s
This commit is contained in:
parent
d964a181ad
commit
02cc4f8ed8
@ -22,7 +22,7 @@ jobs:
|
|||||||
git config user.name "Gitea Actions"
|
git config user.name "Gitea Actions"
|
||||||
git config user.email "actions@gitea.local"
|
git config user.email "actions@gitea.local"
|
||||||
|
|
||||||
- name: Merge master branch
|
- name: Rebase from master branch
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
commits_ahead=$(git rev-list --count HEAD..origin/master)
|
commits_ahead=$(git rev-list --count HEAD..origin/master)
|
||||||
@ -30,14 +30,14 @@ jobs:
|
|||||||
git log --oneline -5
|
git log --oneline -5
|
||||||
echo "----------"
|
echo "----------"
|
||||||
git log --oneline -5 origin/master
|
git log --oneline -5 origin/master
|
||||||
|
echo .
|
||||||
|
|
||||||
if [ $commits_ahead -ne 0 ]
|
if [ $commits_ahead -ne 0 ]
|
||||||
then
|
then
|
||||||
git fetch origin
|
git rebase -X theirs origin/master
|
||||||
git merge -X theirs --squash origin/master
|
git push --force-with-lease origin flake-updates
|
||||||
git commit -m "Merge master branch squashed $(date -I)"
|
|
||||||
else
|
else
|
||||||
echo "Merge not necessary"
|
echo "Rebase not necessary"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Set up Nix
|
- name: Set up Nix
|
||||||
@ -54,4 +54,4 @@ jobs:
|
|||||||
git diff --cached --quiet && echo "No changes to commit." && exit 0
|
git diff --cached --quiet && echo "No changes to commit." && exit 0
|
||||||
|
|
||||||
git commit -m "Update flake.lock $(date -I)"
|
git commit -m "Update flake.lock $(date -I)"
|
||||||
git push origin flake-updates
|
git push --force-with-lease origin flake-updates
|
||||||
|
Loading…
x
Reference in New Issue
Block a user