Get the current GitHub repository name provided by a CI environment or extracted from a git repository.
import { githubRepository } from '@zendeskgarden/scripts';
(async () => {
const repository = await githubRepository(path?: string);
if (repository) {
const { owner, repo } = repository;
console.log(`${owner}/${repo}`);
}
})();
path
optional path to a git directory; defaults to the current directory.
garden github-repository [path]