Compare commits

..

4 Commits

Author SHA1 Message Date
3263a37074 workflow: push right after rebasing
Some checks failed
Update Nix Flake / update-flake (push) Failing after 15s
2025-03-23 18:57:16 +01:00
fc412f2596 workflow: use rebase instead of merge 2025-03-23 18:51:49 +01:00
c9862e6efc workflow: change cron time
Some checks failed
Update Nix Flake / update-flake (push) Failing after 6s
2025-03-22 10:51:21 +01:00
ed52562b55 workflow: use git diff --cached 2025-03-22 10:51:13 +01:00

View File

@ -2,7 +2,7 @@ name: Update Nix Flake
on:
schedule:
- cron: "30 0 * * *" # daily run
- cron: "45 0 * * *" # daily run
workflow_dispatch: {}
jobs:
@ -22,7 +22,7 @@ jobs:
git config user.name "Gitea Actions"
git config user.email "actions@gitea.local"
- name: Merge main branch
- name: Rebase from main branch
shell: bash
run: |
commits_ahead=$(git rev-list --count HEAD..origin/main)
@ -30,14 +30,14 @@ jobs:
git log --oneline -5
echo "----------"
git log --oneline -5 origin/main
echo .
if [ $commits_ahead -ne 0 ]
then
git fetch origin
git merge -X theirs --squash origin/main
git commit -m "Merge main branch squashed $(date -I)"
git rebase -X theirs origin/main
git push --force-with-lease origin flake-updates
else
echo "Merge not necessary"
echo "Rebase not necessary"
fi
- name: Set up Nix
@ -50,9 +50,8 @@ jobs:
shell: bash
run: |
git add flake.lock
if git diff --quiet; then
echo "No changes to commit."
else
git commit -m "Update flake.lock $(date -I)"
git push origin flake-updates
fi
git status
git diff --cached --quiet && echo "No changes to commit." && exit 0
git commit -m "Update flake.lock $(date -I)"
git push --force-with-lease origin flake-updates