forked from maehr/zotero-bib-to-gh
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 1.31 KB
/
zotero-bib-to-git.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
name: GitHub action to retrieve Zotero collection in BibLaTeX format and save it as GitHub repository
on:
schedule:
- cron: "0 8,12,18 * * *"
push:
branches:
- test
workflow_dispatch:
jobs:
zotero-bib-to-gh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run
run: python zotero-bib-to-gh.py
env:
ZOTERO_USER_ID: ${{ secrets.ZOTERO_USER_ID }}
ZOTERO_BEARER_TOKEN: ${{ secrets.ZOTERO_BEARER_TOKEN }}
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
echo `git add -A && git commit -m "Add changes"`
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}