Sync Papers from Feishu #19
This file contains hidden or 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: Sync Papers from Feishu | |
| on: | |
| schedule: | |
| - cron: "0 18 * * *" # daily at 18:00 UTC = 02:00 Beijing time | |
| workflow_dispatch: # allow manual trigger | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: pip install requests | |
| - name: Run sync script | |
| env: | |
| FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }} | |
| FEISHU_APP_SECRET: ${{ secrets.FEISHU_APP_SECRET }} | |
| FEISHU_APP_TOKEN: ${{ secrets.FEISHU_APP_TOKEN }} | |
| FEISHU_TABLE_ID: ${{ secrets.FEISHU_TABLE_ID }} | |
| run: python scripts/sync_papers.py | |
| - name: Commit and push if data changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add data/papers.json assets/images/papers/ | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit." | |
| else | |
| git commit -m "chore: sync papers from Feishu [skip ci]" | |
| git push | |
| fi |