Update addbook.txt #41
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: sqlupdate | |
on: | |
push: | |
branches: | |
- updatesql | |
paths: | |
- Database/Register/datum/addbook.txt | |
jobs: | |
update-db: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Checkout the `updatesql` branch | |
- name: Checkout updatesql branch | |
uses: actions/checkout@v2 | |
with: | |
ref: updatesql | |
fetch-depth: 0 | |
# 2. Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.12" | |
# 3. Install dependencies | |
- name: Install Python dependencies | |
run: | | |
pip install SQLAlchemy bs4 requests | |
# 4. Run the Python script | |
- name: Run Python program | |
run: | | |
python -m Database.Register.register_actions | |
# 5. Checkout the `release` branch | |
- name: Checkout release branch | |
run: | | |
git fetch origin release | |
git checkout release -- Database/ompooscores.db | |
# 7. Commit and push changes to `release` | |
- name: Commit and push changes | |
run: | | |
git config --global user.name "${{ secrets.GITHUBNAME }}" | |
git config --global user.email "${{ secrets.EMAIL }}" | |
git add Database/ompooscores.db | |
git commit -m "Update ompooscores.db after Python script execution" || echo "No changes to commit" | |
git push origin release |