This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
GitHub action to retrieve Zotero collection in BibLaTeX format and save it as GitHub repository #2885
This file contains 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: 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@v4 | |
- 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 }} |