Backup sparql queries #499
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: 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 |