Repository navigation
On GitHub Free, org secrets do not reach private repositories - #18
Conversation
THE FAILURE IS SILENT AND THE CHECK GOES GREEN, which is the worst way for this to be wrong. GitHub delivers an ORGANISATION Actions secret only to PUBLIC repositories on the Free plan. Every repository this standard creates is private by default, so `secrets.SHAPE_LEGS_APP_ID` resolves to the empty string inside the workflow — no error, no warning — the App-token steps skip, the legs go unfetched, and `validate` reports SUCCESS with the lockstep pin check degraded away. Somebody who configured everything correctly gets a green required check that verified nothing. Measured on InkRouter, 2026-09-04, the second organisation to adopt: the `openreposhape` App was installed on all repositories and both org secrets existed at `visibility: all`, and both split pull requests still ran `leg credential source: none` and fetched no legs. MedxSoft is on Enterprise, which is why the identical configuration works there and the difference went unnoticed until an org on Free tried it. The fix is repository secrets, which ARE delivered to private repositories on every plan, or a Team upgrade. `scripts/repo_shape.py` gains `free_plan_secret_hint()`, called by all three tools that create a private repository — `scaffold-project.py`, `adopt-project.py execute` and `family.py init`. It reads `gh api orgs/<org> --jq .plan.name` and prints the hint only on a confident `free`. Every other answer is silent: no `gh` on PATH, a failed call, an empty or unparseable response, a paid plan. Offline and local-remote modes therefore print nothing rather than guess, because a wrong hint about credentials is worse than none. Documented in the README and in the assembly-root and family-root template READMEs — the tool hint reaches whoever ran the tool, the READMEs reach whoever inherits the repository afterwards. The README section is written to four lines because `test_readme_is_short_enough_to_be_read` caps the file at 508 and that cap is the point; it now sits exactly at 508. `tests/test_free_plan_hint.py` stubs `gh` as a shell script on PATH and pins the hint in BOTH directions — it appears on `free` (including `"Free "`, since the answer is stripped and casefolded) and stays silent on team, enterprise, business, a failed call, an empty answer and no `gh` at all — plus that all three creating tools call it with their own org and all three documents say it. Full suite green: 344 passed. Lane: repo-shape Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T
Reviewer's GuideThe PR adds a fail-safe GitHub Free-plan check that warns creators when organization Actions secrets will not reach their private repositories, integrates it into all private-repository creation paths, documents the repository-secret workaround, and adds focused coverage for detection, silence-on-uncertainty, integration, and documentation. Sequence diagram for Free-plan secret hint during repository creationsequenceDiagram
participant Creator
participant Tool as scaffold/adopt/family
participant Hint as free_plan_secret_hint
participant GH as GitHub CLI
Creator->>Tool: Create private repository
Tool->>Hint: free_plan_secret_hint(org, repo, what)
Hint->>GH: gh api orgs/{org} --jq .plan.name
alt plan is free
GH-->>Hint: Free
Hint-->>Tool: Repository-secret warning
Tool-->>Creator: Print warning
else non-free, failed, empty, or gh unavailable
GH-->>Hint: No confident free result
Hint-->>Tool: None
Tool-->>Creator: Continue silently
end
Flow diagram for Free-plan Actions secret failure and workaroundflowchart LR
A[Org Actions secrets] --> B{GitHub Free plan?}
B -->|Private repository| C[Secrets resolve to empty]
C --> D[App steps skip]
D --> E[Legs are not fetched]
E --> F[validate passes with pin check skipped]
B -->|Use repository secrets| G[Secrets reach private repository]
B -->|Upgrade to Team| G
G --> H[validate can check the lockstep pins]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="scripts/repo_shape.py" line_range="592-594" />
<code_context>
+ rather than guess — a wrong hint about credentials is worse than none.
+ """
+ try:
+ proc = subprocess.run(
+ ["gh", "api", f"orgs/{org}", "--jq", ".plan.name"],
+ capture_output=True, text=True, check=False)
+ except (FileNotFoundError, OSError):
+ return None
</code_context>
<issue_to_address>
**issue (bug_risk):** `free_plan_secret_hint` performs a network-backed `gh api` call without a timeout, so an authenticated but unreachable or stalled GitHub endpoint blocks the repository-creation command indefinitely instead of returning silently as documented.
**Triggers:** When `gh` is installed and the network connection or GitHub API request hangs after repository creation.
**Suggested fix:** Pass a finite `timeout` to `subprocess.run` and catch `subprocess.TimeoutExpired` alongside the existing launch errors.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: scripts/repo_shape.py:594
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| proc = subprocess.run( | ||
| ["gh", "api", f"orgs/{org}", "--jq", ".plan.name"], | ||
| capture_output=True, text=True, check=False) |
There was a problem hiding this comment.
issue (bug_risk): free_plan_secret_hint performs a network-backed gh api call without a timeout, so an authenticated but unreachable or stalled GitHub endpoint blocks the repository-creation command indefinitely instead of returning silently as documented.
Triggers: When gh is installed and the network connection or GitHub API request hangs after repository creation.
Suggested fix: Pass a finite timeout to subprocess.run and catch subprocess.TimeoutExpired alongside the existing launch errors.
There was a problem hiding this comment.
🟡 Changes recommended
There are a few concrete reliability/clarity issues (best-effort gh api call can hang without a timeout; hint wording/subject mismatch; brittle source-formatting assertion) that should be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a best-effort diagnostic to prevent a silent/green validation degradation on GitHub Free orgs where organization Actions secrets are not delivered to private repositories, and documents the required workaround (repository secrets) in the generated READMEs.
Changes:
- Add
free_plan_secret_hint()inscripts/repo_shape.pyand call it from the repo-creating entrypoints (scaffold/adopt/family init). - Document the GitHub Free org-secret limitation and the
--repo-scoped secret setup in the main README and both templates. - Add a new test module to pin the hint’s behavior and ensure all creator tools and docs include the note.
File summaries
| File | Description |
|---|---|
scripts/repo_shape.py |
Adds the Free-plan detection and hint text emitted at repository creation time. |
scaffold-project.py |
Calls the hint when creating private/internal repositories. |
adopt-project.py |
Calls the hint when adoption creates private/internal repositories. |
scripts/family.py |
Calls the hint when initializing a private/internal family holder. |
README.md |
Documents the Free-plan org-secret limitation and repo-secret workaround. |
templates/assembly-root/README.md |
Carries the same guidance into generated assembly roots. |
templates/family-root/README.md |
Carries the same guidance into generated family roots. |
tests/test_free_plan_hint.py |
Adds coverage for Free-plan detection behavior, tool integration, and doc presence. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| hint = free_plan_secret_hint( | ||
| plan.get("org", ""), repositories["assembly"], | ||
| f"{repositories['spec']} and {repositories['code']} are") |
| hint = free_plan_secret_hint( | ||
| args.org, repositories["assembly"], | ||
| f"{repositories['spec']} and {repositories['code']} are") |
| try: | ||
| proc = subprocess.run( | ||
| ["gh", "api", f"orgs/{org}", "--jq", ".plan.name"], | ||
| capture_output=True, text=True, check=False) | ||
| except (FileNotFoundError, OSError): | ||
| return None | ||
| if proc.returncode != 0: | ||
| return None | ||
| if proc.stdout.strip().lower() != "free": | ||
| return None |
| source = (REPO / tool).read_text() | ||
| assert "free_plan_secret_hint" in source, f"{tool} does not import it" | ||
| assert f"free_plan_secret_hint(\n {call}" in source, \ | ||
| f"{tool} does not call it with its own org" |



Lane: repo-shape
The failure is silent and the check goes green. GitHub delivers an ORGANISATION Actions secret only to PUBLIC repositories on the Free plan. Every repository this standard creates is private by default, so
secrets.SHAPE_LEGS_APP_IDresolves to the empty string inside the workflow — no error, no warning — the App-token steps skip, the legs go unfetched, andvalidatereports success with the lockstep pin check degraded away. Somebody who configured everything correctly gets a green required check that verified nothing.Measured, not hypothesised
InkRouter, 2026-09-04, the second organisation to adopt: theopenreposhapeApp was installed on all repositories and both org secrets existed atvisibility: all, and both split pull requests still ranleg credential source: noneand fetched no legs.MedxSoftis on Enterprise, which is why the identical configuration works there and the difference went unnoticed until an org on Free tried it.The exits are repository secrets — which are delivered to private repositories on every plan — or a Team upgrade.
What this adds
scripts/repo_shape.pygainsfree_plan_secret_hint(), called by all three tools that create a private repository:scaffold-project.py,adopt-project.py execute,family.py init. It readsgh api orgs/<org> --jq .plan.nameand prints only on a confidentfree.Every other answer is silent — no
ghon PATH, a failed call, an empty or unparseable response, a paid plan. Offline and local-remote modes print nothing rather than guess: a wrong hint about credentials is worse than none.Documented in the README and both the assembly-root and family-root template READMEs. The tool hint reaches whoever ran the tool; the READMEs reach whoever inherits the repository afterwards.
Tests
tests/test_free_plan_hint.pystubsghas a shell script onPATHand pins the hint in both directions: present onfree(including"Free "— the answer is stripped and casefolded), absent on team/enterprise/business, a failed call, an empty answer, and noghat all. Plus that all three creating tools call it with their own org, and all three documents carry the note.Full suite green: 344 passed. The README section is written to four lines because
test_readme_is_short_enough_to_be_readcaps the file at 508 and that cap is the point — it now sits exactly at 508.Not for merge
Opened for review only, per the instruction that produced it.
🤖 Generated with Claude Code
https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T
Summary by Sourcery
Warn users when GitHub Free prevents organization secrets from reaching private repositories so credential configuration does not silently degrade validation.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: