Update Literature Review #6
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 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 |