Files
davila7__claude-code-templates/.github/workflows/update-json-data.yml
dependabot[bot] 6f3706669b chore(deps): bump actions/checkout from 4 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-25 06:43:46 +00:00

84 lines
2.6 KiB
YAML

name: Update JSON Data
on:
schedule:
# Ejecutar todos los días a las 3:00 AM UTC
- cron: '0 3 * * *'
workflow_dispatch: # Permite ejecutar manualmente desde GitHub UI
permissions:
contents: write
jobs:
update-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'cli-tool/package-lock.json'
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install requests python-dotenv
- name: Install Node.js dependencies
run: |
cd cli-tool
npm ci --ignore-scripts
- name: Create .env file with secrets
run: |
echo "SUPABASE_URL=${{ secrets.SUPABASE_URL }}" >> .env
echo "SUPABASE_API_KEY=${{ secrets.SUPABASE_API_KEY }}" >> .env
- name: Generate components.json
run: python scripts/generate_components_json.py
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_API_KEY: ${{ secrets.SUPABASE_API_KEY }}
- name: Generate trending-data.json
run: python scripts/generate_trending_data.py
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_API_KEY: ${{ secrets.SUPABASE_API_KEY }}
- name: Generate claude-jobs.json
run: python scripts/generate_claude_jobs.py
- name: Copy data to dashboard
run: |
cp docs/claude-jobs.json dashboard/public/claude-jobs.json
- name: Check for changes
id: check_changes
run: |
git diff --quiet docs/components.json docs/trending-data.json docs/claude-jobs.json dashboard/public/claude-jobs.json || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and push changes
if: steps.check_changes.outputs.changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs/components.json docs/trending-data.json docs/claude-jobs.json dashboard/public/claude-jobs.json
git commit -m "chore: Update components and trending data
🤖 Generated with [GitHub Actions](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
git push