Fix workflow race condition with cancel-in-progress and pull-first strategy
Update Calendar / update-calendar (push) Successful in 6s
Details
Update Calendar / update-calendar (push) Successful in 6s
Details
This commit is contained in:
parent
26cda0f1ec
commit
5d654a72c0
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue