Skip to main content
Dotset CLI API Documentation / index / PipelineContext

Interface: PipelineContext

Defined in: src/mantle/ci/index.ts:679 CI/CD Integration Module Native integration with GitHub Actions, GitLab CI, and other CI providers.

Example

import {
  detectCIEnvironment,
  ExitCodes,
  determineExitCode,
  writeGitHubSummary,
  createGitHubAnnotation,
  ArtifactManager,
} from '@dotsetlabs/cli';

// Detect CI environment
const env = detectCIEnvironment();
console.log(`Running on: ${env.provider}`);

// Determine exit code based on findings
const exitCode = determineExitCode(scanResult, { failOnSeverity: 'high' });

// GitHub Actions: Write job summary
if (env.provider === 'github') {
  await writeGitHubSummary(scanResult);

  // Create annotations for findings
  for (const finding of scanResult.findings) {
    createGitHubAnnotation(finding);
  }
}

// Manage artifacts
const artifacts = new ArtifactManager({ basePath: './artifacts' });
await artifacts.write('sarif', sarifContent, { filename: 'mantle-results.sarif' });

process.exit(exitCode);

Properties

artifacts

artifacts: ArtifactInfo[];
Defined in: src/mantle/ci/index.ts:685

ci

ci: CIEnvironment;
Defined in: src/mantle/ci/index.ts:680

endTime?

optional endTime: Date;
Defined in: src/mantle/ci/index.ts:682

exitCode?

optional exitCode: ExitCode;
Defined in: src/mantle/ci/index.ts:683

result?

optional result: ScanResult;
Defined in: src/mantle/ci/index.ts:684

startTime

startTime: Date;
Defined in: src/mantle/ci/index.ts:681