-
Notifications
You must be signed in to change notification settings - Fork 49
61 lines (50 loc) · 1.58 KB
/
daily.yml
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
name: Run Daily Arxiv
on:
workflow_dispatch:
schedule:
- cron: "00 12 * * *"
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_NAME: github-actions[bot]
GITHUB_EMAIL: github-actions[bot]@users.noreply.github.com
jobs:
sync:
name: Update Daily Arxiv
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: 'pip'
cache-dependency-path: 'requirements.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run daily arxiv
id: daily-arxiv
run: python daily_arxiv.py
continue-on-error: false
- name: Commit and push changes
if: success()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.G_T }}
script: |
const fs = require('fs');
await exec.exec('git', ['config', '--global', 'user.name', process.env.GITHUB_NAME]);
await exec.exec('git', ['config', '--global', 'user.email', process.env.GITHUB_EMAIL]);
await exec.exec('git', ['add', 'README.md', 'daily.json', 'archives']);
await exec.exec('git', ['commit', '-m', 'update today arxiv']);
await exec.exec('git', ['push']);