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:
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue