Skip to content

read time sync

read time sync #1911

Workflow file for this run

name: read time sync
on:
workflow_dispatch:
schedule:
- cron: "0 */3 * * *"
jobs:
sync:
name: Sync
runs-on: ubuntu-latest
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
NOTION_PAGE: ${{ secrets.NOTION_PAGE }}
WEREAD_COOKIE: ${{ secrets.WEREAD_COOKIE }}
BOOK_DATABASE_NAME: ${{ vars.BOOK_DATABASE_NAME }}
AUTHOR_DATABASE_NAME: ${{ vars.AUTHOR_DATABASE_NAME }}
CATEGORY_DATABASE_NAME: ${{ vars.CATEGORY_DATABASE_NAME }}
BOOKMARK_DATABASE_NAME: ${{ vars.BOOKMARK_DATABASE_NAME }}
REVIEW_DATABASE_NAME: ${{ vars.REVIEW_DATABASE_NAME }}
CHAPTER_DATABASE_NAME: ${{ vars.CHAPTER_DATABASE_NAME }}
YEAR_DATABASE_NAME: ${{ vars.YEAR_DATABASE_NAME }}
WEEK_DATABASE_NAME: ${{ vars.WEEK_DATABASE_NAME }}
MONTH_DATABASE_NAME: ${{ vars.MONTH_DATABASE_NAME }}
DAY_DATABASE_NAME: ${{ vars.DAY_DATABASE_NAME }}
REF: ${{ github.ref }}
REPOSITORY: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: weread heatmap
run: |
github_heatmap weread --weread_cookie "${{secrets.WEREAD_COOKIE}}" --year $(date +"%Y") --me "${{secrets.NAME}}" --with-animation --background-color=#ffffff --track-color=#ACE7AE --special-color1=#69C16E --special-color2=#549F57 --dom-color=#EBEDF0 --text-color=#000000
- name: push
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m 'add new cover' || echo "nothing to commit"
git push || echo "nothing to push"
- name: read time sync
run: |
python -u scripts/read_time.py