Endpoint Check #213
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: Endpoint Check | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 6 * * *" | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| jobs: | |
| check-endpoints: | |
| name: Endpoint Check | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && contains(github.event.pull_request.labels.*.name, 'run-endpoint-check')) | |
| env: | |
| CTX_API_KEY: ${{ secrets.CTX_API_KEY }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.11" | |
| - name: Install project (editable) | |
| run: pip install -e . | |
| - name: Run endpoint checker | |
| if: ${{ env.CTX_API_KEY != '' }} | |
| run: python scripts/check_endpoints.py --json > endpoint_status.json | |
| - name: Mark check as skipped (missing CTX_API_KEY) | |
| if: ${{ env.CTX_API_KEY == '' }} | |
| run: | | |
| echo '{"skipped": true, "reason": "CTX_API_KEY secret is not configured for this repository"}' > endpoint_status.json | |
| echo "Skipping endpoint check because CTX_API_KEY is not configured." | |
| - name: Upload results artifact | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: endpoint-status | |
| path: endpoint_status.json |