Daily Update #9
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: Daily Update | |
on: | |
workflow_dispatch: | |
jobs: | |
update-and-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12.4" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run update script | |
run: | | |
python main.py | |
- name: Generate commit message | |
id: generate_commit_message | |
run: | | |
LATEST_VERSIONS=$(python generate_commit.py) | |
echo "LATEST_VERSIONS=${LATEST_VERSIONS}" >> $GITHUB_ENV | |
- name: Commit changes | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "github-actions@github.com" | |
git add version.json genshin/ starrail/ | |
if git diff-index --quiet HEAD; then | |
echo "No changes to commit." | |
else | |
git remote set-url origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/ScobbleQ/HoYo-Assets.git | |
git commit -m "${{ env.LATEST_VERSIONS }}" | |
git push | |
fi |