Compare commits
4 Commits
8d9892e958
...
main
Author | SHA1 | Date | |
---|---|---|---|
3263a37074 | |||
fc412f2596 | |||
c9862e6efc | |||
ed52562b55 |
@ -2,7 +2,7 @@ name: Update Nix Flake
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "30 0 * * *" # daily run
|
- cron: "45 0 * * *" # daily run
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -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 main branch
|
- name: Rebase from main branch
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
commits_ahead=$(git rev-list --count HEAD..origin/main)
|
commits_ahead=$(git rev-list --count HEAD..origin/main)
|
||||||
@ -30,14 +30,14 @@ jobs:
|
|||||||
git log --oneline -5
|
git log --oneline -5
|
||||||
echo "----------"
|
echo "----------"
|
||||||
git log --oneline -5 origin/main
|
git log --oneline -5 origin/main
|
||||||
|
echo .
|
||||||
|
|
||||||
if [ $commits_ahead -ne 0 ]
|
if [ $commits_ahead -ne 0 ]
|
||||||
then
|
then
|
||||||
git fetch origin
|
git rebase -X theirs origin/main
|
||||||
git merge -X theirs --squash origin/main
|
git push --force-with-lease origin flake-updates
|
||||||
git commit -m "Merge main branch squashed $(date -I)"
|
|
||||||
else
|
else
|
||||||
echo "Merge not necessary"
|
echo "Rebase not necessary"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Set up Nix
|
- name: Set up Nix
|
||||||
@ -50,9 +50,8 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
git add flake.lock
|
git add flake.lock
|
||||||
if git diff --quiet; then
|
git status
|
||||||
echo "No changes to commit."
|
git diff --cached --quiet && echo "No changes to commit." && exit 0
|
||||||
else
|
|
||||||
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
|
||||||
fi
|
|
||||||
|
Reference in New Issue
Block a user