Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/evi/agent/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const BEFORE_AFTER_CLI = '@vercel/before-and-after@0.0.4'
*/
export default defineSandbox({
backend: defaultBackend({ vercel: { resources: { vcpus: 4 } } }),
revalidationKey: () => `evlog-workspace-v3:${agentBrowserRevalidationKey()}:${BEFORE_AFTER_CLI}`,
revalidationKey: () => `evlog-workspace-v4:${agentBrowserRevalidationKey()}:${BEFORE_AFTER_CLI}`,
async bootstrap({ use }) {
const sandbox = await use()
await sandbox.run({ command: 'git clone --depth 50 https://github.com/HugoRCD/evlog.git repo' })
Expand All @@ -27,6 +27,12 @@ export default defineSandbox({
},
async onSession({ use }) {
const sandbox = await use()
// The template snapshot is owned by the builder uid, not the session user;
// without these entries every git command, this fetch included, dies on
// "dubious ownership" and the GitHub channel checkout fails silently.
// Written here rather than in bootstrap so they land in the session
// identity's own config whatever HOME it resolves to.
await sandbox.run({ command: 'git config --global --add safe.directory /workspace && git config --global --add safe.directory /workspace/repo' })
await sandbox.run({ command: 'cd repo && git fetch origin main && git checkout -B main origin/main' })
},
})
Loading