/** * Repository where the change was made. */ public GHRepository getRepository() throws IOException { return root.getRepository(repo.name); }
/** * Repository where the change was made. */ @SuppressFBWarnings(value = {"UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR" }, justification = "The field comes from JSON deserialization") public GHRepository getRepository() throws IOException { return root.getRepository(repo.name); }
/** * Repository where the change was made. */ @SuppressFBWarnings(value = {"UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR" }, justification = "The field comes from JSON deserialization") public GHRepository getRepository() throws IOException { return root.getRepository(repo.name); }
@Override /*package*/ GHCommit[] getItems(GitHub root) { for (GHCommit commit : items) { String repoName = getRepoName(commit.url); try { GHRepository repo = root.getRepository(repoName); commit.wrapUp(repo); } catch (IOException ioe) {} } return items; } }
@Override /*package*/ GHCommit[] getItems(GitHub root) { for (GHCommit commit : items) { String repoName = getRepoName(commit.url); try { GHRepository repo = root.getRepository(repoName); commit.wrapUp(repo); } catch (IOException ioe) {} } return items; } }
/** * Forked repositories have a 'source' attribute that specifies the ultimate source of the forking chain. * * @return * {@link GHRepository} that points to the root repository where this repository is forked * (indirectly or directly) from. Otherwise null. * @see #getParent() */ public GHRepository getSource() throws IOException { if (source == null) return null; if (source.root == null) source = root.getRepository(source.getFullName()); return source; }
@Override protected GHRepository applyNullSafe(@Nonnull GitHub gitHub) { try { return gitHub.getRepository(format("%s/%s", repoName.getUserName(), repoName.getRepositoryName())); } catch (IOException e) { LOGGER.warn("Failed to obtain repository {}", this, e); return null; } } };
public Optional<String> getLatestCommitShaOnBranch(String githubRepo, String branchName) { try { return Optional.of(gitHub.getRepository(githubRepo).getBranch(branchName).getSHA1()); } catch (Exception e) { logger.warn("Could not get latest commit on branch from Github!", e); return Optional.empty(); } }
public static void addVersionStoreRepo(GitHub github, List<GHRepository> createdRepos, String storeName) throws IOException { String login = github.getMyself().getLogin(); GHRepository storeRepo = github.getRepository(Paths.get(login, storeName).toString()); createdRepos.add(storeRepo); } }
public Updater() { ResourceBundle rs = ResourceBundle.getBundle("version"); currentVersion = new Version(rs.getString("version")); try { repository = GitHub.connectAnonymously().getRepository(REPO_NAME); } catch (IOException e) { e.printStackTrace(); } }
@Override public void checkConnection(GitConfig gitConfig) { try { loginWith(gitConfig).getRepository(GHUtils.parseGithubUrl(gitConfig.getEffectiveUrl())); } catch (Exception e) { throw new RuntimeException(String.format("check connection failed. %s", e.getMessage()), e); } }
protected GHRepository getGithubRepository(StaplerRequest request) throws IOException { String repoName = request.getParameter("fullName"); GitHub github = getGitHub(request); return github.getRepository(repoName); }
private GHRepository openRepo(GitHubLocation location) throws IOException { final GitHub github = location.open(); final GHRepository repo = github.getRepository(location.getRepoName()); return repo; } }
public void setDefaultBranch(String branchName) throws IOException { ghRepo.setDefaultBranch(branchName); ghRepo = gitHub.getRepository(ghRepo.getFullName()); }
void updateCommitStatus(String revision, String pipelineStage, String trackbackURL, String repository, GHCommitState state, String usernameToUse, String passwordToUse, String oauthAccessTokenToUse, String endPointToUse) throws Exception { GitHub github = createGitHubClient(usernameToUse, passwordToUse, oauthAccessTokenToUse, endPointToUse); GHRepository ghRepository = github.getRepository(repository); ghRepository.createCommitStatus(revision, state, trackbackURL, "", pipelineStage); }
private synchronized GHRepository getRepository() { if (this.repository == null) { final String fullRepoName = new GitUrl(this.repoUrl).getFullRepoName(); try { this.repository = getGithub().getRepository(fullRepoName); } catch (final IOException e) { throw new RuntimeException(e); } } return this.repository; }
public void scanRepository(String name) { try { scanRepository(getGitHubClient().getRepository(name)); } catch (IOException e) { throw new MercatorException(e); } }
private GHPullRequest pullRequestFrom(GitConfig gitConfig, int currentPullRequestID) throws IOException { return loginWith(gitConfig) .getRepository(GHUtils.parseGithubUrl(gitConfig.getEffectiveUrl())) .getPullRequest(currentPullRequestID); }
public GitHubRepository getRepository(String name) { validateGitHubConfiguration(); validateRepositoryName(name); GitHubRepository repository = null; try { GHRepository gitHubRepository = gitHub.getRepository(name); repository = mapGhRepository(gitHubRepository); } catch (IOException e) { Log.e("Error retrieving repository " + name); } return repository; }
public String forkRepository(String repository, AbstractStep step) throws IOException { GitHub gh = RepairnatorConfig.getInstance().getGithub(); showGitHubRateInformation(gh, step); if (gh.getRateLimit().remaining > 10) { GHRepository originalRepo = gh.getRepository(repository); if (originalRepo != null) { return originalRepo.fork().getUrl().toString(); } } return null; }