Skip to content

CI/CD Automation

SCC supports non-interactive operation for CI/CD pipelines, automated testing, and scripted workflows.

For automation, use flags that prevent interactive prompts:

Terminal window
scc start --non-interactive --team backend ~/project

Key flags:

FlagDescription
--non-interactiveFail fast instead of prompting
--team TEAMSpecify team (required in non-interactive)
--dry-runPreview configuration without launching
--jsonMachine-readable output
.github/workflows/scc.yml
name: SCC Validation
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install SCC
run: pip install scc-cli
- name: Validate configuration
run: scc start --dry-run --json --non-interactive --team ci .
env:
SCC_ORG_URL: ${{ secrets.SCC_ORG_URL }}

Preview configuration without actually launching:

Terminal window
scc start --dry-run ~/project

With JSON output for parsing:

Terminal window
scc start --dry-run --json --non-interactive --team backend ~/project

Output:

{
"status": "ok",
"data": {
"workspace": "/home/runner/project",
"entry_directory": "/home/runner/project",
"team": "backend",
"plugins": ["scc-safety-net", "java-analyzer"],
"network_policy": "corp-proxy-only"
},
"metadata": {
"cli_version": "1.5.0",
"timestamp": "2024-01-15T10:30:00Z"
}
}

Use exit codes for pipeline logic:

CodeMeaning
0Success
2Usage error (bad arguments)
3Configuration error
4Tool error (Docker, git)
5Prerequisites not met
6Governance block
130Cancelled (SIGINT)
Terminal window
scc start --dry-run --non-interactive --team ci .
exit_code=$?
if [ $exit_code -eq 6 ]; then
echo "Configuration blocked by governance policy"
exit 1
fi

Configure SCC via environment:

VariableDescription
SCC_ORG_URLOrganization config URL
SCC_TEAMDefault team profile
SCC_DEBUGEnable debug output
Terminal window
export SCC_ORG_URL="https://example.com/org-config.json"
export SCC_TEAM="ci"
scc start --dry-run --non-interactive .

Create a minimal CI profile:

{
"profiles": {
"ci": {
"description": "CI/CD pipeline profile",
"additional_plugins": [],
"session": {
"timeout_hours": 1,
"auto_resume": false
},
"network_policy": "isolated"
}
}
}

In CI, validate your team config changes:

Terminal window
# Validate config syntax
scc org validate team-config.json
# Check if changes would break anything
scc team validate

Audit plugins as part of your pipeline:

Terminal window
scc audit plugins --json

Check for unexpected plugins or changes.

CI runners start fresh each time. Consider:

  • Pre-warming: Cache ~/.cache/scc/ between runs
  • Offline mode: Use --offline if config is embedded
  • Config caching: Cache org config to avoid network calls
- uses: actions/cache@v4
with:
path: ~/.cache/scc
key: scc-cache-${{ hashFiles('**/org-config.json') }}
  • Store org URL in CI secrets
  • Use token auth for private config repos
  • Review what gets logged (use --json to control output)
  • Consider network isolation for CI containers