-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.58 KB
/
update_literature_review.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
name: Update Literature Review
# Triggers the workflow on a schedule (every day at midnight) or manually
on:
schedule:
- cron: '0 0 * * *' # This runs daily at midnight UTC
workflow_dispatch: # Allows manual triggering from the GitHub Actions UI
jobs:
update-literature-review:
runs-on: ubuntu-latest # Specifies the environment where the job will run
steps:
# Checkout the repository code
- name: Checkout repository
uses: actions/checkout@v2
# Set up a Python environment
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x' # Uses Python version 3.x
# Install necessary dependencies -- requests library for fetching Google Sheets data
- name: Install requests
run: pip install requests
# Run the Python script that updates the 'literature-review' file
- name: Run Python script
run: python literature-review-update-script.py
# Commit and push the updated 'literature-review' file back to the repository
- name: Commit and push changes
run: |
git config --global user.name 'GitHub Actions' # Set Git author name
git config --global user.email '[email protected]' # Set Git author email
git add literature-review # Stage the updated file
git commit -m 'Update literature-review with latest table' # Commit the changes
git push # Push the changes back to the repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use the GITHUB_TOKEN to authenticate the push