mirror of
https://github.com/jlengrand/github-templates.git
synced 2026-03-12 08:21:25 +00:00
35 lines
1.1 KiB
Java
35 lines
1.1 KiB
Java
package com.amazon.ask.githubtemplates.handlers.github;
|
|
|
|
import org.javatuples.Pair;
|
|
import org.kohsuke.github.GitHub;
|
|
import org.kohsuke.github.GitHubBuilder;
|
|
|
|
import java.io.IOException;
|
|
import java.util.Map;
|
|
|
|
public class GithubAPI {
|
|
|
|
public static final Map<String, Pair<String, String>> TEMPLATES =
|
|
Map.of(
|
|
"java", new Pair<>("Spring-Boot-Framework", "Spring-Boot-Application-Template"),
|
|
"typescript", new Pair<>("carsonfarmer", "ts-template"),
|
|
"javascript", new Pair<>("jlengrand", "openwc-template"),
|
|
"HTML", new Pair<>("jlengrand", "openwc-template"),
|
|
"elm", new Pair<>("jlengrand", "elm-firebase")
|
|
);
|
|
|
|
private GitHub github;
|
|
|
|
public GithubAPI() throws GithubInitException {
|
|
try {
|
|
github = GitHubBuilder.fromEnvironment().build();
|
|
} catch (IOException e) {
|
|
throw new GithubInitException("Impossible to login the Github API");
|
|
}
|
|
}
|
|
|
|
public GitHub getGithub() {
|
|
return github;
|
|
}
|
|
}
|