-
I'd like to add a new method to the import { Context } from 'probot';
declare module 'probot' {
interface Context {
octokit: {
git: {
createBranch(name: String): boolean;
};
};
}
}
Context.prototype.octokit.git.createBranch = async (name: String) {
// I need the context instance available here
} Can somebody help me out? ^^ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can extend Octokit using plugins
Then you can pass your own import { Server, Probot, ProbotOctokit } from "probot";
import { createBranch } from "./create-branch-plugin.js";
import { app } from "./index.js"
async function startServer() {
const server = new Server({
Probot: createProbot({
Octokit: ProbotOctokit.plugin(createBranch)
}),
});
await server.load(app);
server.start();
} Then you can use The environment variables for configuration should still work, they are read out by The |
Beta Was this translation helpful? Give feedback.
You can extend Octokit using plugins
Then you can pass your own
Octokit
constructor, depending on how you are running your app. If you use a long living process, you can use theServer
export