Get mhy wish #294
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: Get mhy wish | |
on: | |
push: | |
branches: | |
- master | |
- dev-py | |
- dev-game | |
paths: | |
- ".github/workflows/get-mhy-wish.yml" | |
- "script/game/**" | |
- "script/utils.py" | |
pull_request: | |
types: [opened, synchronize] | |
branches: | |
- master | |
paths: | |
- ".github/workflows/get-mhy-wish.yml" | |
- "script/game/**" | |
- "script/utils.py" | |
schedule: | |
# This is run at midnight UTC on Monday, Tuesday and Wednesday | |
- cron: "0 16 * * 1-3" | |
# 在 UTC 时间的凌晨 4 点执行(周二)(即周二的中午 UTC+8) | |
- cron: "0 4 * * 2" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
py-game-wish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository content | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r script/requirements.txt | |
- name: Execute Python script | |
run: | | |
python -m script.game.official_chara.2 | |
python -m script.game.official_chara.8 | |
python -m script.game.official_wish.2 1 | |
- name: Commit files | |
id: commit | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
pwd | |
git add . | |
if git diff --cached --quiet; then | |
echo "No changes to commit" | |
echo "has_changes=false" >> $GITHUB_OUTPUT | |
else | |
git commit -m "feat: auto wish" -a | |
echo "has_changes=true" >> $GITHUB_OUTPUT | |
fi | |
# - name: Push changes | |
# uses: ad-m/github-push-action@master | |
# with: | |
# github_token: ${{ secrets.DEPLOY_GH }} | |
# branch: ${{ github.head_ref }} | |
- name: Create Pull Request | |
if: steps.commit.outputs.has_changes == 'true' && github.event_name != 'pull_request' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.DEPLOY_GH }} | |
title: "feat: auto get mhy wish" | |
commit-message: "feat: auto get mhy wish" | |
committer: GitHub <[email protected]> | |
author: GitHub <[email protected]> | |
branch: create-pull-request/patch-wish-new | |
base: master | |
labels: | | |
report | |
automated pr | |
assignees: DrAugus | |
# Review cannot be requested from pull request author. | |
# reviewers: DrAugus |