Skip to main content
Use Charter in GitHub Actions when you want every pull request to run the same repo scan your local workflow runs. This guide adds a dedicated Charter workflow, sets the score threshold, uploads SARIF to GitHub Code Scanning, and blocks merges when the score falls below the gate.
1

Add the workflow file

Create .github/workflows/charter.yaml:
The security-events: write permission is required to upload SARIF to GitHub Code Scanning. Without it, findings won’t appear in the GitHub Security tab, but the threshold gate still works.
Why each permission is present:
2

Configure the threshold

Set the minimum passing score in the workflow or in charter.yaml. Common values:
The default for most repos. Enforces the baseline agent-readiness rules without requiring a fully optimized repo.
The threshold workflow input wins over anything in charter.yaml, which wins over the built-in default of 80. For the full precedence ladder, see Policy Profiles.
3

View results in the GitHub Security tab

After the workflow runs, Charter findings appear in the GitHub Security tab as code scanning alerts:
Charter findings in GitHub Security tab

GitHub Code Scanning — Charter findings as security alerts

Each finding includes:
  • the rule ID and severity
  • the file and line where Charter detected the issue
  • a link to the rule documentation
4

Understand exit behavior

Charter preserves its CLI exit semantics through the action:
SARIF upload completes before the threshold check. Even on a failing score, you still get Code Scanning annotations AND a failed CI check — both are useful for triage.
If you want annotations without blocking merges, set fail-below: false:

Troubleshooting

Confirm security-events: write is present in the workflow permissions block. Also check that the workflow log shows a successful SARIF upload step — look for the upload-sarif action output.
Check that fail-below is not set to "false". Then confirm the effective threshold by looking at Charter’s output in the workflow log — the threshold in use is printed at scan start.
Check that the use-charter/charter-action@v1 ref is published and reachable. On self-hosted runners, confirm bash, gh, curl, tar, and sha256sum are available in the shell environment.

Next steps

GitHub Action

Full input, output, and gate-semantics reference for the composite action.

Policy Profiles

Set a consistent threshold once instead of per-run.

charter.yaml Reference

Configure policy and the MCP allowlist at the repo root.

Use Charter in a Pre-Commit Hook

Match the CI gate locally so commits and CI agree.