name: Update Calendar on: push: branches: - main paths: - 'meetings.yaml' - 'generate_calendar.py' - '.gitea/workflows/update-calendar.yaml' schedule: # Run daily at 00:00 UTC - cron: '0 0 * * *' workflow_dispatch: concurrency: group: update-calendar cancel-in-progress: false jobs: update-calendar: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies run: | pip install pyyaml - 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" else 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