From 26cda0f1ec6f5041ba2f32c5d1626fc731363255 Mon Sep 17 00:00:00 2001 From: Drew Date: Fri, 26 Dec 2025 21:39:07 +0000 Subject: [PATCH] Fix workflow race condition with concurrency control and pull-rebase - Add concurrency group to prevent parallel workflow runs - Pull and rebase before pushing to handle remote changes - Auto-regenerate files if rebase fails to resolve conflicts --- .gitea/workflows/update-calendar.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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