From 5d654a72c0ccd8ad24f4bc41f88cdb07287f471d Mon Sep 17 00:00:00 2001 From: Drew Date: Sat, 27 Dec 2025 22:13:11 -0500 Subject: [PATCH] Fix workflow race condition with cancel-in-progress and pull-first strategy --- .gitea/workflows/update-calendar.yaml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/update-calendar.yaml b/.gitea/workflows/update-calendar.yaml index dfb3079..444eb1c 100644 --- a/.gitea/workflows/update-calendar.yaml +++ b/.gitea/workflows/update-calendar.yaml @@ -15,7 +15,7 @@ on: concurrency: group: update-calendar - cancel-in-progress: false + cancel-in-progress: true jobs: update-calendar: @@ -33,14 +33,18 @@ jobs: run: | pip install pyyaml + - name: Pull latest changes + run: | + git config --local user.email "noreply@thelinuxcast.org" + git config --local user.name "Calendar Bot" + git pull origin main + - name: Generate calendar files run: | python generate_calendar.py - name: Commit and push changes run: | - git config --local user.email "noreply@thelinuxcast.org" - git config --local user.name "Calendar Bot" git add calendar.ics README.md if git diff --staged --quiet; then echo "No changes to commit" @@ -48,16 +52,5 @@ jobs: git commit -m "Auto-update calendar files 🤖 Generated with automation" - # 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