Fix workflow race condition with cancel-in-progress and pull-first strategy
Update Calendar / update-calendar (push) Successful in 6s Details

This commit is contained in:
Drew 2025-12-27 22:13:11 -05:00
parent 26cda0f1ec
commit 5d654a72c0
1 changed files with 7 additions and 14 deletions

View File

@ -15,7 +15,7 @@ on:
concurrency: concurrency:
group: update-calendar group: update-calendar
cancel-in-progress: false cancel-in-progress: true
jobs: jobs:
update-calendar: update-calendar:
@ -33,14 +33,18 @@ jobs:
run: | run: |
pip install pyyaml 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 - name: Generate calendar files
run: | run: |
python generate_calendar.py python generate_calendar.py
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git config --local user.email "noreply@thelinuxcast.org"
git config --local user.name "Calendar Bot"
git add calendar.ics README.md git add calendar.ics README.md
if git diff --staged --quiet; then if git diff --staged --quiet; then
echo "No changes to commit" echo "No changes to commit"
@ -48,16 +52,5 @@ jobs:
git commit -m "Auto-update calendar files git commit -m "Auto-update calendar files
🤖 Generated with automation" 🤖 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 git push
fi fi