workflow: use merge instead of rebase

This commit is contained in:
Julian Mutter 2025-03-22 08:34:16 +01:00
parent 595a9761d0
commit b0b6ef6bba

View File

@ -16,10 +16,18 @@ jobs:
fetch-depth: 0
ref: flake-updates
- name: Fetch latest changes and rebase
- name: Git config
shell: bash
run: |
git fetch origin
git rebase origin/main
git config user.name "Gitea Actions"
git config user.email "actions@gitea.local"
- name: Merge main branch
run: |
git merge --squash origin/main
# solve merge conflict by taking flake.lock from main
git checkout origin/main -- flake.lock
git commit -m "Merge main branch squashed $(date -I)"
- name: Set up Nix
uses: cachix/install-nix-action@v31
@ -30,12 +38,10 @@ 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
echo "No changes to commit."
else
git commit -m "Update flake.lock $(date -I)"
git push --force-with-lease origin flake-updates
git push origin flake-updates
fi