Hourly Sync #1155
This file contains hidden or 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: Hourly Sync | |
| on: | |
| schedule: | |
| - cron: "0 0/4 * * *" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Ping Cron Endpoint | |
| env: | |
| # APP_URL is a non-sensitive deployment URL stored as a repository | |
| # variable (vars), not a secret, so it is safe to log and inject here. | |
| APP_URL: ${{ vars.APP_URL }} | |
| CRON_SECRET: ${{ secrets.CRON_SECRET }} | |
| run: | | |
| if [ -z "$APP_URL" ] || [ -z "$CRON_SECRET" ]; then | |
| echo "APP_URL or CRON_SECRET not set. Skipping." | |
| exit 0 | |
| fi | |
| curl -f -X POST "$APP_URL/api/cron" \ | |
| -H "Authorization: Bearer $CRON_SECRET" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{}" |