import { GitStorage } from '@pierre/storage';
const store = new GitStorage({
name: 'your-org',
key: env.privateKey,
});
const repo = await store.createRepo({ id: 'new-workspace' });
const result = await repo
.createCommit({
targetBranch: 'main',
commitMessage: 'Get Started with Code Storage',
author: { name: 'Pierre', email: '[email protected]' },
})
.addFileFromString('README.md', '# Getting Started\n')
.addFileFromString('main.ts', 'console.log("Hello from Code Storage");')
.send();
console.log(result.commitSha);