-
Couldn't load subscription status.
- Fork 0
Getting Started
_Coho04_ edited this page Jun 19, 2024
·
1 revision
To get started with GithubAPI, follow these steps to interact with GitHub repositories:
- Initialize GithubAPI:
Github github = new Github("your_access_token");- Get Repository by Organisation:
GHOrganisation organisation = github.findOrganisationByName("organisation_name");
GHRepository repository = organisation.findRepositoryByName("repo_name");
System.out.println("Repository name: " + repository.getName());- Get Repository by User:
GHUser user = github.findUserByName("username");
GHRepository userRepository = user.findRepositoryByName("repo_name");
System.out.println("Repository name: " + userRepository.getName());- Get Repositories by SelfUser:
GHUser selfUser = github.getSelfUser();
GHRepository selfUserRepository = selfUser.findRepositoryByName("repo_name");
System.out.println("Repository name: " + selfUserRepository.getName());These examples demonstrate how to authenticate, and retrieve repositories by organization, user, and the authenticated user. Make sure to replace "your_access_token", "organisation_name", "username", and "repo_name" with actual values.
- Email: [email protected]
- Issues: Github Issues
- Documentation: GithubAPI Documentation
Thank you for using GithubAPI! Your contributions and feedback are appreciated.