summaryrefslogtreecommitdiff
path: root/.github/workflows/daily_papers.yml
blob: 510e75c1e45eec9b47b81fe8aac81d76d58e2804 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Arxiv LLM Bias Paper Fetcher

on:
  schedule:
    # Run daily at 12:00 UTC
    - cron: '0 12 * * *'
  workflow_dispatch:
    inputs:
      mode:
        description: 'Fetch mode: daily or historical'
        required: true
        default: 'daily'
        type: choice
        options:
          - daily
          - historical
      days:
        description: 'Number of days to fetch (only for daily mode)'
        required: false
        default: '1'
        type: string

jobs:
  fetch-papers:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Cache pip dependencies
        uses: actions/cache@v4
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
          restore-keys: |
            ${{ runner.os }}-pip-

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt

      - name: Run paper fetcher (Daily Mode)
        if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'daily')
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          TARGET_REPO_TOKEN: ${{ secrets.TARGET_REPO_TOKEN }}
          TARGET_REPO_NAME: "YurenHao0426/awesome-llm-bias-papers"
          FETCH_MODE: "daily"
          FETCH_DAYS: ${{ github.event.inputs.days || '1' }}
        run: python scripts/fetch_papers.py

      - name: Run paper fetcher (Historical Mode)
        if: github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'historical'
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          TARGET_REPO_TOKEN: ${{ secrets.TARGET_REPO_TOKEN }}
          TARGET_REPO_NAME: "YurenHao0426/awesome-llm-bias-papers"
          FETCH_MODE: "historical"
        run: python scripts/fetch_papers.py

      - name: Log completion
        run: |
          echo "Paper fetching completed successfully!"
          echo "Mode: ${{ github.event.inputs.mode || 'daily' }}"
          echo "Repository: YurenHao0426/awesome-llm-bias-papers"