Example in file packages/server/scripts/test-server.ts
interface IBackendGitlabOptions {
host?: string;
timeout?: number;
version?: string;
privateToken: string;
basePath?: string;
}
backendGitlab({
privateToken: process.env.GITLAB_PRIVATE_TOKEN || "",
host: process.env.GITLAB_HOST,
});Use privateToken or appToken to authenticate.
interface IBackendGithubOptions {
timeout?: number;
basePath?: string;
privateToken?: string;
appToken?: {
appId: string;
privateKey: string;
};
}
const backendTypeGithub = backendGithub({
// privateToken: process.env.GITHUB_PRIVATE_TOKEN || "",
appToken: {
appId: process.env.GITHUB_APP_ID || "",
privateKey:
(process.env.GITHUB_PRIVATE_KEY &&
Buffer.from(process.env.GITHUB_PRIVATE_KEY, "base64").toString(
"utf-8",
)) ||
"",
},
});contents: write, metadata: read.
Don't forget to configure the repository access in the Github App settings installed in the organization or repository.
backendFilesystem({
cwd: join(__dirname, "../../react-admin-example"),
});