Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔍 govwatch-action

Fail fast when a government API your workflow depends on is down.
The govwatch health checker, packaged as a GitHub Action.


Government APIs go down. A lot. If your app ingests data from Congress.gov, FEC, CISA, or any of the 17 public sources govwatch monitors, this action tells your CI whether an upstream outage is about to break your build — or your users.

- uses: CapitolTrace/govwatch-action@v1
  with:
    services: congress fec cisa-kev

Each run prints per-service results to the log, writes a table to the job summary, and fails the step when any checked API is unhealthy (HTTP errors, bad payloads, stale feeds — see health check anatomy). To see what these checks report right now, visit status.capitoltrace.com — the same checks running every 30 minutes.

Usage

Check before deploying

jobs:
  preflight:
    runs-on: ubuntu-latest
    steps:
      - uses: CapitolTrace/govwatch-action@v1
        with:
          services: congress fec        # only the APIs you depend on
        env:
          DATA_GOV_API_KEY: ${{ secrets.DATA_GOV_API_KEY }}

Scheduled uptime monitoring

on:
  schedule:
    - cron: '*/30 * * * *'
jobs:
  monitor:
    runs-on: ubuntu-latest
    steps:
      - uses: CapitolTrace/govwatch-action@v1
        with:
          strict: true                  # degraded/rate-limited also fail

Use the results programmatically

- uses: CapitolTrace/govwatch-action@v1
  id: gw
  continue-on-error: true
- name: Alert on outage
  if: steps.gw.outputs.outcome == 'unhealthy'
  env:
    RESULTS: ${{ steps.gw.outputs.results }}
  run: ./notify-slack.sh "$RESULTS"

Inputs

Input Default Description
services (all 17) Slugs to check, space- or comma-separated. npx @capitoltrace/govwatch list shows all slugs.
strict false Also fail on degraded / rate-limited.
timeout (per-service) Per-request timeout in ms.
version latest @capitoltrace/govwatch version to run.
summary true Write the results table to the job summary.

Outputs

Output Description
results Full JSON array of check results (service, status, statusCode, responseTime, failures).
outcome healthy, degraded, or unhealthy.

API keys

Most services need no configuration. Pass keys for keyed services as env vars on the action step — keyed services without a key are skipped, never failed. See the govwatch key table for the full list (DATA_GOV_API_KEY, OPENSTATES_API_KEY, CENSUS_API_KEY, …).

Requirements

A runner with Node.js 18.17+ and npm (all GitHub-hosted runners qualify, including Windows and macOS). The underlying package has zero runtime dependencies — the install adds ~14 kB.

Versioning

Pin @v1 to track the latest v1.x, or an exact tag like @v1.0.0.

License

MIT


Part of the Capitol Trace ecosystem.
Because democracy runs on uptime.

About

GitHub Action: fail fast when government APIs are down — powered by @capitoltrace/govwatch

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages