Skip to content

Generate Config (0:00, UTC+8) #198

Generate Config (0:00, UTC+8)

Generate Config (0:00, UTC+8) #198

name: Generate Config (0:00, UTC+8)
permissions:
contents: write
on:
schedule:
- cron: "0 16 * * *"
workflow_dispatch:
jobs:
generate-config:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
with:
enable-cache: true
- name: Install dependencies
shell: bash
run: |
uv sync --locked --all-extras --dev
- name: Generate config files
shell: bash
run: |
uv run python core/scripts/config_generate.py
- name: Commit and push changes
shell: bash
run: |
if [[ -z "$(git status --porcelain assets/)" ]]; then
echo "No config changes detected."
exit 0
fi
echo "Config files changed, committing..."
git config user.email "action@github.com"
git config user.name "GitHub Action"
git add assets/
git commit -m "Update Config [skip ci]"
git push origin master