Files
alighasami 3d5eaf9445
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
first commit
2026-03-17 16:22:57 +03:30

39 lines
1.1 KiB
TypeScript

/**
* CI Metadata for LangSmith experiments.
*
* Provides metadata to distinguish CI runs from local development runs
* and to track provenance of automated evaluation results.
*
* Note: Git info (commit SHA, branch) is not included here as LangSmith
* automatically tracks it via LANGSMITH_REVISION_ID and LANGSMITH_BRANCH.
*/
export interface CIMetadata {
/** Whether this run is from CI or local development */
source: 'ci' | 'local';
/** The GitHub Actions event that triggered this run (e.g., 'push', 'release', 'workflow_dispatch') */
trigger?: string;
/** The GitHub Actions run ID for linking back to the workflow run */
runId?: string;
}
/**
* Build CI metadata from environment variables.
*
* When running in GitHub Actions, populates metadata from standard GH environment variables.
* When running locally, only sets source to 'local'.
*/
export function buildCIMetadata(): CIMetadata {
const isCI = process.env.GITHUB_ACTIONS === 'true';
if (!isCI) {
return { source: 'local' };
}
return {
source: 'ci',
trigger: process.env.GITHUB_EVENT_NAME,
runId: process.env.GITHUB_RUN_ID,
};
}