-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.4 KB
/
run-script.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
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 }}
run: |
./update_all_libs.sh $CLIENT_ID $CLIENT_SECRET $ACCESS_TOKEN