Export Notion Coursera Notes #1872
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: Export Notion Coursera Notes | |
on: | |
schedule: | |
- cron: '0 * * * *' # Runs every hour | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
export: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
pip install notion-client notion-exporter | |
- name: Export Notion Notes | |
env: | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
TOP_PAGE_ID: ${{ secrets.TOP_PAGE_ID }} | |
run: | | |
python export_notion.py | |
- name: Configure Git | |
run: | | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email 'actions@github.com' | |
- name: Commit and Push Changes | |
run: | | |
git add . | |
git commit -m 'Update Notion notes' | |
git push https://x-access-token:${{ secrets.ACTIONS_TOKEN }}@github.com/${{ github.repository }} HEAD:${{ github.ref }} |