forked from molecule-ai/molecule-core
chore(template): authenticated git clone in initial_prompt when GITHUB_TOKEN is set
Fixes the template-layer half of #13. Previously initial_prompt cloned `https://github.com/${GITHUB_REPO}.git` with no authentication, which fails for private repos in non-TTY docker exec with: fatal: could not read Username for 'https://github.com': terminal prompts disabled Now the prompt uses `https://x-access-token:${GITHUB_TOKEN}@github.com/...` when GITHUB_TOKEN is present in env (global secret, set per CEO on 2026-04-13), falls back to anonymous clone when it isn't. This is a belt-and-suspenders template default. The platform-level fix (#13) is still needed so the provisioner rewrites clone URLs consistently, but the template should work out of the box too.
This commit is contained in:
parent
e920aaab8e
commit
e0b76b04f4
@ -16,7 +16,12 @@ defaults:
|
||||
# be ready yet. Keep it local: clone, read, memorize. Wait for tasks.
|
||||
initial_prompt: |
|
||||
You just started. Set up your environment silently — do NOT contact other agents yet.
|
||||
1. Clone the repo: git clone https://github.com/${GITHUB_REPO}.git /workspace/repo 2>/dev/null || (cd /workspace/repo && git pull)
|
||||
1. Clone the repo (authenticated when GITHUB_TOKEN is available, anonymous otherwise):
|
||||
if [ -n "$GITHUB_TOKEN" ]; then
|
||||
git clone "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}.git" /workspace/repo 2>/dev/null || (cd /workspace/repo && git pull)
|
||||
else
|
||||
git clone "https://github.com/${GITHUB_REPO}.git" /workspace/repo 2>/dev/null || (cd /workspace/repo && git pull)
|
||||
fi
|
||||
2. Set up git hooks: cd /workspace/repo && git config core.hooksPath .githooks
|
||||
3. Read /workspace/repo/CLAUDE.md to understand the project
|
||||
4. Read your system prompt at /configs/system-prompt.md to understand your role
|
||||
|
||||
Loading…
Reference in New Issue
Block a user