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), andcicd.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) forpull_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_SUMMARYon exit. Best-effort; never fails the job. - Zero lost CI telemetry. An
atexithook callsforce_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 (requiresid-token: write) instead of a static secret; falls back to configured auth if unavailable. - Runs locally too. Outside CI (
GITHUB_ACTIONSunset) it falls back to a plainconfigure()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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forgesight_github-0.1.1.tar.gz.
File metadata
- Download URL: forgesight_github-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20c3246cf34857a02fef80f0fdba2a04da25d7fd4b420315dccd6b074eb85d6c
|
|
| MD5 |
4c1cfe49b320f91573cc1822f0bf794e
|
|
| BLAKE2b-256 |
d474c83357fed4a5986cde6b22ae0c6f8f67781bded9c1a9b7c7ccdcc404540d
|
File details
Details for the file forgesight_github-0.1.1-py3-none-any.whl.
File metadata
- Download URL: forgesight_github-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33fb994f80dabb18fb7e34a896139645201095eaa3cfae64b24198f72f5fc501
|
|
| MD5 |
bad2659b1a7675df82d1386e25899afd
|
|
| BLAKE2b-256 |
70a6c7b9e5ad5b7f9989414f2d21e17fae6d186c2a79404be5d97f92d9acbd34
|