diff --git a/.gitea/workflows/update-calendar.yaml b/.gitea/workflows/update-calendar.yaml index 22a3e3b..dfb3079 100644 --- a/.gitea/workflows/update-calendar.yaml +++ b/.gitea/workflows/update-calendar.yaml @@ -13,6 +13,10 @@ on: - cron: '0 0 * * *' workflow_dispatch: +concurrency: + group: update-calendar + cancel-in-progress: false + jobs: update-calendar: runs-on: ubuntu-latest @@ -44,6 +48,16 @@ jobs: git commit -m "Auto-update calendar files 🤖 Generated with automation" - git pull --rebase origin main + # Pull latest changes and rebase our commit on top + git pull --rebase origin main || { + # If rebase fails, regenerate files to resolve conflicts + git rebase --abort + git pull origin main + python generate_calendar.py + git add calendar.ics README.md + git commit -m "Auto-update calendar files + + 🤖 Generated with automation" + } git push fi