Update library.bib periodically #509
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: Update library.bib periodically | |
on: | |
schedule: | |
# Runs every 2 hours | |
- cron: "0 */2 * * *" | |
workflow_dispatch: # Allow manual triggering of the workflow | |
inputs: | |
run_message: | |
description: "Message to log when running manually" | |
required: false | |
default: "Manual trigger initiated" | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 # Specify the Python version you need | |
# Step 3: Install Python dependencies | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
# Step 4: Configure Git | |
- name: Configure Git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
# Step 5: Run the script | |
- name: Run bash script with secrets | |
env: # Pass secrets as environment variables | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} | |
run: | | |
./update_all_libs.sh $CLIENT_ID $CLIENT_SECRET $ACCESS_TOKEN $REFRESH_TOKEN |