Fetch Bookwhen ICS File daily #214
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fetch Bookwhen ICS File daily | |
on: | |
push: | |
branches: [ main ] | |
schedule: | |
# Runs at 2 AM PST every day | |
- cron: '0 10 * * *' | |
workflow_dispatch: # allow manual triggering | |
jobs: | |
fetch-and-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Fetch the file | |
run: | | |
curl -o public/calendars/bookwhen.ics https://feeds.bookwhen.com/ical/x3ixm04f5wj7/yf23z4/public.ics | |
curl -o public/calendars/google.ics https://calendar.google.com/calendar/ical/sequoiafabrica%40gmail.com/public/basic.ics | |
- name: Commit and push if there were changes | |
run: | | |
git config --local user.name "GitHub Actions Bot" | |
git config --local user.email "[email protected]" | |
git add public/calendars/bookwhen.ics | |
git add public/calendars/google.ics | |
git remote set-url origin https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository }} | |
git commit -m "Updated .ics by GitHub Actions Bot" || echo "No changes to commit" | |
git pull | |
git push | |
env: | |
GIT_AUTHOR_NAME: GitHub Actions Bot | |
GIT_AUTHOR_EMAIL: [email protected] |