我正在使用org.kohsuke.github。*;
通过kohsuke github可能吗?
通过kohsuke的文档
public static GHRepository createFork(String repo) throws IOException{
GHRepository mainRepo = github.getRepository(repo);
GHRepository forkedRepo = mainRepo.fork();
GHCommit commit = copyFiles();
/*QUESTION: Here is where I need help. Now that I have the
commit that has the files I need how to I add them to
forkedRepo?******** */
GHCommitBuilder builder = forkedRepo.createCommit();
return forkedRepo;
}
public static GHCommit copyFiles() throws IOException {
GHRepository mainRepo = github.getRepository("sandbox/xyz");
/* xxxxxxxxx is the sha of commit that has templated files.
GHCommit commit = mainRepo.getCommit("xxxxxxxxxxx");
GHContent content = new GHContent();
return commit;
}