Skip to content

Backup sparql queries #487

Backup sparql queries

Backup sparql queries #487

name: Backup sparql queries
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
run_script:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Set Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "rschalkrce"
- name: Execute Python script
run: |
python retrieve_queries.py
changes=$(git status --porcelain)
if [ -n "$changes" ]; then
git add .
git commit -m "Automated backup of SPARQL queries"
git push
else
echo "No changes to commit."
fi