Skip to content

GitHub Actions Integration

SCC CLI integrates with GitHub Actions for automated configuration validation and AI coding governance.

.github/workflows/scc-validate.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 uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install SCC
run: uv tool install scc-cli
- name: Configure SCC
run: scc setup --org "$SCC_ORG_SOURCE" --auth env:SCC_ORG_TOKEN --team ci --non-interactive
env:
SCC_ORG_SOURCE: ${{ secrets.SCC_ORG_SOURCE }}
SCC_ORG_TOKEN: ${{ secrets.SCC_ORG_TOKEN }}
- name: Validate configuration
run: scc start --dry-run --json --non-interactive --team ci .

Add these secrets to your repository (Settings → Secrets):

SecretDescription
SCC_ORG_SOURCEURL or shorthand for your org config
SCC_ORG_TOKENAuth token for private configs (if needed)
name: Validate SCC Config
on:
pull_request:
paths:
- '.scc.yaml'
- 'team-config.json'
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 team config
run: scc team validate --file team-config.json
name: Weekly Plugin Audit
on:
schedule:
- cron: '0 9 * * 1' # Every Monday at 9am
jobs:
audit:
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: Configure SCC
run: scc setup --org "$SCC_ORG_SOURCE" --non-interactive
env:
SCC_ORG_SOURCE: ${{ secrets.SCC_ORG_SOURCE }}
- name: Audit plugins
run: scc audit plugins --json

Speed up workflows by caching SCC configuration:

- uses: actions/cache@v4
with:
path: ~/.cache/scc
key: scc-cache-${{ hashFiles('**/org-config.json') }}
restore-keys: |
scc-cache-

Use exit codes for conditional workflow logic:

CodeMeaningAction
0SuccessContinue
2Usage errorCheck command syntax
3Configuration errorFix config files
6Governance blockReview policy violations
- name: Check validation result
run: |
scc start --dry-run --non-interactive --team ci .
exit_code=$?
if [ $exit_code -eq 6 ]; then
echo "::error::Configuration blocked by governance policy"
exit 1
fi

Create a minimal profile for CI environments:

{
"profiles": {
"ci": {
"description": "CI/CD pipeline profile",
"additional_plugins": [],
"session": {
"timeout_hours": 1
},
"network_policy": "isolated"
}
}
}
  • Never expose secrets in logs: Use GitHub’s secret masking
  • Use minimal permissions: CI profiles should be restrictive
  • Validate before merge: Catch config issues in PRs
  • Review JSON output: Parse --json output for detailed validation results

Ensure $HOME/.local/bin is in PATH after installing with uv:

- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH

For dry-run validation, Docker isn’t required. For actual sessions, ensure your runner has Docker:

runs-on: ubuntu-latest # Has Docker pre-installed

Your configuration violates org policies. Run scc config explain locally to see what’s blocked.