The previous combined workflow had flawed conditional logic that caused sync-keyword and sync-metrics jobs to be skipped. GitHub Actions doesn't populate github.event.schedule with the cron expression, so the equality checks never matched. Replaced with three separate workflow files: - sync-changes.yml: Runs every 2 minutes - sync-keyword.yml: Runs every 15 minutes - sync-metrics.yml: Runs every hour Each workflow can be manually triggered via workflow_dispatch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
18 lines
472 B
YAML
18 lines
472 B
YAML
name: Sync NPM Metrics
|
|
|
|
on:
|
|
schedule:
|
|
# Run every hour
|
|
- cron: '0 * * * *'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
sync-metrics:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Trigger metrics sync
|
|
run: |
|
|
curl -X POST "${{ secrets.VERCEL_PRODUCTION_URL }}/api/sync/metrics" \
|
|
-H "Authorization: Bearer ${{ secrets.CRON_SECRET }}" \
|
|
-H "Content-Type: application/json" \
|
|
-f -s -S -w "\nHTTP Status: %{http_code}\n"
|