Skip to content

Commit

Permalink
Update sync_articles.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
paulofeh committed Dec 17, 2024
1 parent 29d6195 commit ba7f28f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/sync_articles.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: Sync Readwise Articles to Capacities

on:
workflow_dispatch: # Keep manual trigger
workflow_dispatch: # Keep manual trigger
schedule:
- cron: '0 */12 * * *' # Runs every 12 hours
- cron: "0 3 * * *" # Runs at midnight São Paulo time (UTC-3)

permissions:
contents: write # This allows the workflow to push changes
actions: read # This is for basic workflow functionality
contents: write # This allows the workflow to push changes
actions: read # This is for basic workflow functionality

jobs:
sync:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create empty processed_ids file if it doesn't exist
run: touch processed_ids.txt

- name: Run sync script
env:
READWISE_TOKEN: ${{ secrets.READWISE_TOKEN }}
CAPACITIES_TOKEN: ${{ secrets.CAPACITIES_TOKEN }}
CAPACITIES_SPACE_ID: ${{ secrets.CAPACITIES_SPACE_ID }}
run: python main.py

- name: Commit and push if processed_ids.txt changed
run: |
git config --global user.name 'GitHub Action'
Expand All @@ -49,4 +49,4 @@ jobs:
git push
else
echo "No changes to processed_ids.txt"
fi
fi

0 comments on commit ba7f28f

Please sign in to comment.