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