workflow: use merge --squash instead of rebase
This commit is contained in:
parent
68e02739be
commit
b76da6e9eb
@ -16,10 +16,29 @@ jobs:
|
||||
fetch-depth: 0
|
||||
ref: flake-updates
|
||||
|
||||
- name: Fetch latest changes and reset branch
|
||||
- name: Git config
|
||||
shell: bash
|
||||
run: |
|
||||
git fetch origin master
|
||||
git reset --hard origin/master
|
||||
git config user.name "Gitea Actions"
|
||||
git config user.email "actions@gitea.local"
|
||||
|
||||
- name: Merge master branch
|
||||
shell: bash
|
||||
run: |
|
||||
commits_ahead=$(git rev-list --count HEAD..origin/master)
|
||||
echo "Commits ahead: $commits_ahead"
|
||||
git log --oneline -5
|
||||
echo "----------"
|
||||
git log --oneline -5 origin/master
|
||||
|
||||
if [ $commits_ahead -ne 0 ]
|
||||
then
|
||||
git fetch origin
|
||||
git merge -X theirs --squash origin/master
|
||||
git commit -m "Merge master branch squashed $(date -I)"
|
||||
else
|
||||
echo "Merge not necessary"
|
||||
fi
|
||||
|
||||
- name: Set up Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
@ -30,10 +49,8 @@ jobs:
|
||||
- name: Commit and push changes
|
||||
shell: bash
|
||||
run: |
|
||||
git config user.name "Gitea Actions"
|
||||
git config user.email "actions@gitea.local"
|
||||
git add flake.lock
|
||||
if git diff --cached --quiet; then
|
||||
if git diff --quiet; then
|
||||
echo "No changes to commit."
|
||||
else
|
||||
git commit -m "Update flake.lock $(date -I)"
|
||||
|
Loading…
x
Reference in New Issue
Block a user