-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1.36 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
42
43
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: # Allow manual triggering from the GitHub Actions UI?
jobs:
update-literature-review:
runs-on: ubuntu-latest
steps:
# Checkout the repository code
- name: Checkout repository
uses: actions/checkout@v2
# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
# Install requests library for fetching Google Sheets data
- name: Install requests
run: pip install requests
# Run script that updates the 'literature-review' file
- name: Run Python script
run: python literature-review-update-script.py
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add literature-review
git commit -m 'Update literature-review with latest table' || echo "No changes to commit"
git push origin HEAD:${{ github.ref }} || echo "No changes to push"
- name: Display file contents
run: cat literature-review.md