Crear update-helpers-cache.yml

This commit is contained in:
MacRimi 2025-06-03 11:00:47 +02:00 committed by GitHub
parent 4ecb3f9943
commit f25d8aec3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,43 @@
name: Update Helper Scripts Cache
on:
# Manual trigger via GitHub Actions UI
workflow_dispatch:
# Scheduled run every 6 hours (00:00, 06:00, 12:00, 18:00 UTC)
schedule:
- cron: "0 */6 * * *"
jobs:
update-cache:
runs-on: ubuntu-latest
permissions:
contents: write # Required to push changes back to the repository
steps:
# Step 1: Checkout the repository code
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
# Step 2: Set up Python environment
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
# Step 3: Install dependencies (requests library)
- name: 📦 Install Python dependencies
run: pip install requests
# Step 4: Run the Python script to generate helpers_cache.json
- name: ⚙️ Generate helpers_cache.json
run: python .github/scripts/generate_helpers_cache.py
# Step 5: Commit and push changes if the file has been updated
- name: 📤 Commit and push if helpers_cache.json has changed
run: |
git config user.name "ProxMenuxBot"
git config user.email "bot@proxmenux.local"
git add helpers_cache.json
git diff --cached --quiet || git commit -m "🔄 Update helpers_cache.json"
git push