Permissions by job
CodeHawk App is the public App owned by bts-io, with App ID 5882014 and bot login codehawk-app[bot]. Its registered permissions cover the jobs below. Each job requests only the slice it needs.
Registered permissions
Section titled “Registered permissions”| Permission | Level | Jobs and reason |
|---|---|---|
| Contents | Write | Fix publication and settings commands create a branch and commits. Static scans, PR reviews and replies read repository context. |
| Pull requests | Write | Static scans, dependency scans, PR reviews, replies, browser flows and fix publication post reports or open PRs. |
| Issues | Write | Weekly review files and closes summary issues. Fix publication and settings commands post replies. PR reviews and replies request read access. |
| Workflows | Write | The setup pull request (#16) adds workflow files. No review, scan or fix job receives it. |
| Deployments | Read | Preview lookup and report jobs in the preview-flows reusable workflow. |
| Metadata | Read | GitHub includes repository metadata access with installation tokens for all App jobs. |
Workflows write is limited to the setup pull request (#16), which adds Code Hawk workflow files. The installation setup flow uses this registered permission to add the caller workflow. The token Worker never issues workflows: write through its exchange endpoint, so review, scan and fix jobs cannot request it there.
Token slices
Section titled “Token slices”The caller's Actions token and the App installation token are separate. Hosted tokens require a released reusable workflow, verified OIDC identity and a nonempty subset of that workflow's event slice. Every token-minting job and its caller grants id-token: write. The job name is not signed, so the Worker grants the union for the workflow and event.
| Workflow | Job | Events | Permission slice |
|---|---|---|---|
pr-review.yml |
review | pull_request | contents read, pull_requests write, issues read |
pr-review.yml |
reply | pull_request_review_comment, issue_comment | contents read, pull_requests write, issues read |
pr-scan.yml |
line-scan-report | pull_request | contents read, pull_requests write |
pr-scan.yml |
osv-report | pull_request | pull_requests write |
weekly-review.yml |
review | schedule, workflow_dispatch | contents read, issues write |
fix-request.yml |
publish | issue_comment, pull_request_review_comment | contents write, pull_requests write, issues write |
fix-issues.yml |
publish | issues, workflow_dispatch | contents write, pull_requests write, issues write |
browser-flows.yml |
report | pull_request | contents read, pull_requests write |
preview-flows.yml |
prepare, report | pull_request | contents read, pull_requests write, deployments read |
settings-command.yml |
apply | issue_comment | contents write, pull_requests write, issues write |
Static scans and dependency scans run with contents read and no OIDC. Separate report jobs have only id-token: write and no checkout. Browser flows run through .github/workflows/browser-flows.yml with contents and pull requests read, then report in a separate job. Verified issue fixes run through .github/workflows/fix-issues.yml with contents and issues read during tests, then publish without a checkout. Fix request resolution uses the caller's checks and actions read token to read failed checks and job logs. No Worker slice includes those permissions.
Related repository tokens grant contents read only on allowed repositories. The hosted Worker reads each related repository's default-branch consent and both repositories' API visibility before issuing a token. Private repositories cannot share context with public callers. On the self-hosted path, the key owner's installation decides access without a consent file.
Keep secrets scoped to the repositories that use them and disable credential persistence for checkouts. Code Hawk never approves or merges pull requests. An approval from the App may count toward required reviews, so keep codehawk-app[bot] out of review requirements and ruleset bypass lists. Protect shared branches with rulesets.
Self-hosted App
Section titled “Self-hosted App”You can register your own App and grant the union of the jobs you enable. The reusable workflows accept its App ID and private key as an opt-in and mint the slices listed above. Keep Workflows write limited to setup.