Skip to main content

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

Metadata

Release files for forgesight-github 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forgesight-github 0.1.1
File Size Uploaded
forgesight_github-0.1.1.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for forgesight-github 0.1.1
File Interpreter ABI Platform
forgesight_github-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.7 kB

Release files / forgesight_github-0.1.1.tar.gz

Download URL forgesight_github-0.1.1.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
20c3246cf34857a02fef80f0fdba2a04da25d7fd4b420315dccd6b074eb85d6c
BLAKE2b-256 checksum
How to use checksums
d474c83357fed4a5986cde6b22ae0c6f8f67781bded9c1a9b7c7ccdcc404540d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / forgesight_github-0.1.1-py3-none-any.whl

Download URL forgesight_github-0.1.1-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33fb994f80dabb18fb7e34a896139645201095eaa3cfae64b24198f72f5fc501
BLAKE2b-256 checksum
How to use checksums
70a6c7b9e5ad5b7f9989414f2d21e17fae6d186c2a79404be5d97f92d9acbd34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page