Repository navigation
Opportunity radar refresh #62
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: Opportunity radar refresh | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "41 5 * * *" | |
| permissions: | |
| contents: read | |
| jobs: | |
| refresh: | |
| name: Refresh monitored opportunity channels | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Refresh backend opportunity radar | |
| env: | |
| FK_BACKEND_ADMIN_TOKEN: ${{ secrets.FK_BACKEND_ADMIN_TOKEN }} | |
| FK_OPPORTUNITY_REFRESH_URL: ${{ vars.FK_OPPORTUNITY_REFRESH_URL || 'https://fkdev-admin-api.onrender.com/admin/opportunities/refresh' }} | |
| run: | | |
| set -euo pipefail | |
| if [ -z "${FK_BACKEND_ADMIN_TOKEN:-}" ]; then | |
| echo "Missing FK_BACKEND_ADMIN_TOKEN repository secret." >&2 | |
| exit 1 | |
| fi | |
| curl --fail --silent --show-error \ | |
| --retry 3 \ | |
| --retry-delay 10 \ | |
| --connect-timeout 20 \ | |
| --max-time 120 \ | |
| -H "Accept: application/json" \ | |
| -H "Content-Type: application/json" \ | |
| -H "X-FK-Backend-Token: ${FK_BACKEND_ADMIN_TOKEN}" \ | |
| -X POST \ | |
| "${FK_OPPORTUNITY_REFRESH_URL}" \ | |
| -o opportunity-refresh.json | |
| python -m json.tool opportunity-refresh.json |