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
This commit is contained in:
parent
39af35d15a
commit
26cda0f1ec
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue