Skip to main content

ForgeSight GitHub Actions integration — one-line CI bootstrap; run↔commit/PR/job correlation.

Project description

forgesight-github

The GitHub Actions integration for ForgeSight. One line in your CI entry script correlates every agent run with the commit / PR / job / workflow that triggered it, and writes a cost+duration+status summary to the job page.

pip install forgesight-github
from forgesight_github import bootstrap
bootstrap()   # configure() + attach GITHUB_* metadata + job summary on exit

# Unchanged agent code — every run in this job is now correlated and flushed cleanly.
result = await pr_reviewer.run(task)
# .github/workflows/review.yml
jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      id-token: write          # only if using OIDC exporter auth
    steps:
      - uses: actions/checkout@v4
      - run: pip install forgesight-github
      - run: python review_agent.py
        env:
          FORGESIGHT_EXPORTERS: otlp
          FORGESIGHT_OTLP_ENDPOINT: ${{ vars.OTEL_COLLECTOR }}

What you get

  • Run↔commit/PR/job link for free. Every run carries vcs.repository.name, vcs.ref.head.revision (sha), vcs.ref.head.name (ref), vcs.change.id (PR number), cicd.pipeline.run.id / .attempt, cicd.pipeline.name (workflow), and cicd.pipeline.task.name (job) as run-scoped metadata (FR-5), so "agent spend on PR #1234" or "spend by workflow" is a one-line backend query.
  • PR number resolved correctly. Parsed from the event payload JSON ($GITHUB_EVENT_PATH) for pull_request* events — absent (not fabricated) otherwise.
  • A useful job summary, automatically. A markdown block — status · cost_usd · duration_ms · n_tool_calls — is appended to $GITHUB_STEP_SUMMARY on exit. Best-effort; never fails the job.
  • Zero lost CI telemetry. An atexit hook calls force_flush() + shutdown() so the ephemeral runner never drops the buffered batch.
  • Safe exporter auth (opt-in). bootstrap(oidc=True) fetches the runner's short-lived OIDC id-token (requires id-token: write) instead of a static secret; falls back to configured auth if unavailable.
  • Runs locally too. Outside CI (GITHUB_ACTIONS unset) it falls back to a plain configure() and warns once.

Configuration

Key Env Default
write_summary FORGESIGHT_GITHUB_SUMMARY true
oidc — (kwarg) false
capture_env — (kwarg) the documented GITHUB_* set

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forgesight_github-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forgesight_github-0.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file forgesight_github-0.1.0.tar.gz.

File metadata

  • Download URL: forgesight_github-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for forgesight_github-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b7ebd5700de6b930a99808e679df6e1b4e56e35693b8eabfc48f8386abf5877
MD5 c25eb9d6bdce598d4d4c4b578653250e
BLAKE2b-256 2ae3d2e0a59aa5ed5e027676297646894fade0ca0b13d2846b56fc7809d22930

See more details on using hashes here.

File details

Details for the file forgesight_github-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for forgesight_github-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d678572dd1b0b128468f93d884db97034b42655e2458ece6a76f45afc48cf052
MD5 51bc162cbb4fa37f452abfdb2599aeb1
BLAKE2b-256 2708c85395647562b919157be87ff479f2b4da6c905a4bad67086a57d8fbba77

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page