You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not use this for production rollout. Without `Actions: write`, `/rr skip` can record the signed ledger but cannot rerun the failed review check automatically.
136
136
137
+
## Security advisory
138
+
139
+
The installer prints a security advisory before writing workflows.
140
+
141
+
It always reminds you that generated workflows:
142
+
143
+
- use `pull_request`, not `pull_request_target`
144
+
- skip fork PR secret-backed review by default
145
+
- keep `/rr skip` handling in a separate workflow
146
+
147
+
When GitHub API access is available, it also checks:
148
+
149
+
- whether the target repository is public while using Codex OAuth
150
+
- whether the default branch has branch protection
151
+
- whether a CODEOWNERS file exists
152
+
- whether CODEOWNERS appears to cover `.github/workflows/**`
153
+
154
+
These checks are warnings, not hard blockers. The main risk is not that collaborators can read Actions secrets in the GitHub UI. The practical risk is workflow-code access: anyone who can get a malicious workflow merged into a repository or push a same-repository branch where secrets are available can try to exfiltrate secrets during CI.
155
+
137
156
## Secret scopes
138
157
139
158
| Scope | Where secrets live | Repository access | Best for |
@@ -259,6 +278,8 @@ ReviewRouter uses a binary-only Codex health check by default. The real review c
259
278
260
279
Use this only in trusted automation. Do not put personal Codex OAuth credentials into public/open-source repos where untrusted workflow changes can access secrets. GitHub does not expose repository secrets to fork PR workflows by default, and the generated workflow skips fork PRs by default.
261
280
281
+
Important auth freshness note: on GitHub-hosted runners, the runner filesystem is ephemeral. Codex can refresh `auth.json` during a run, but ReviewRouter cannot safely write the refreshed file back to GitHub Actions secrets automatically. If the stored secret becomes stale or a refresh token is rotated, run `codex login` again on a trusted machine and rerun the installer or update `CODEX_AUTH_JSON`. For fully automatic long-running auth, prefer an OpenAI API key or a trusted self-hosted runner with persistent `CODEX_HOME`.
if content="$(read_github_file "$codeowners_path""$ref")";then
553
+
printf'%s\n'"$content"
554
+
return 0
555
+
fi
556
+
done
557
+
return 1
558
+
}
559
+
560
+
run_security_advisory() {
561
+
log ""
562
+
info "Security advisory"
563
+
if [ "$AUTH_MODE"="codex" ];then
564
+
warn "Codex OAuth stores your ChatGPT-managed Codex auth.json as an Actions secret. Use it only for trusted private automation; prefer OpenAI API key mode for public/open-source repositories."
565
+
warn "GitHub-hosted runners are ephemeral. If Codex refreshes auth.json during a run, ReviewRouter cannot persist the refreshed file back to GitHub secrets automatically; reseed auth.json if Codex starts returning 401."
566
+
else
567
+
ok "Auth mode does not store Codex OAuth auth.json"
568
+
fi
569
+
ok "Generated workflows use pull_request, skip fork PR secret-backed review, and do not use pull_request_target."
570
+
571
+
if! can_run_remote_checks;then
572
+
warn "Skipping remote repository hardening checks in dry-run/local-only mode"
if [ "$AUTH_MODE"="codex" ] && [ "$repo_visibility"="PUBLIC" ];then
581
+
warn "Target repository is public and auth mode is Codex OAuth. GitHub does not pass Actions secrets to fork PR workflows, but Codex OAuth is still not recommended for public/open-source repos."
582
+
fi
583
+
584
+
if gh api "repos/$TARGET_REPO/branches/$default_branch/protection">/dev/null 2>&1;then
585
+
ok "Default branch protection is enabled on $default_branch"
586
+
if [ "$(gh api "repos/$TARGET_REPO/branches/$default_branch/protection" --jq '.required_pull_request_reviews != null'2>/dev/null ||printf'false')"!="true" ];then
587
+
warn "Default branch protection exists, but required pull request reviews were not detected. Require reviews for workflow changes before relying on secret-backed review."
588
+
fi
589
+
else
590
+
warn "Default branch protection was not detected on $default_branch. Protect the branch before storing Codex OAuth or provider API secrets."
591
+
fi
592
+
593
+
if codeowners="$(find_codeowners_content "$default_branch")";then
0 commit comments