Refactor GitHub Actions workflow

This commit is contained in:
github-actions[bot]
2025-06-12 04:10:34 +02:00
parent cfee8ae049
commit 5c09779d91

View File

@ -38,15 +38,23 @@ jobs:
- name: Run script
run: uv run python scrape.py
- name: Pull latest changes before staging
- name: Stage any changes from scraper
run: |
git add -A
- name: Pull latest changes with rebase
run: |
git config user.name "Joakim Hellsén"
git config user.email "tlovinator@gmail.com"
git pull --rebase https://${{ secrets.REPO_WRITE_PAT }}@git.lovinator.space/TheLovinator/wutheringwaves.git master
- name: Stage updated/deleted files
run: |
git add -u
# If there are staged changes, commit them temporarily
if ! git diff --cached --quiet; then
git commit -m "Temporary commit for rebase"
git pull --rebase https://${{ secrets.REPO_WRITE_PAT }}@git.lovinator.space/TheLovinator/wutheringwaves.git master
# Reset to unstage the temporary commit but keep the changes
git reset --soft HEAD~1
else
git pull --rebase https://${{ secrets.REPO_WRITE_PAT }}@git.lovinator.space/TheLovinator/wutheringwaves.git master
fi
- name: Get the files that will be committed
id: get_modified_files