repository provider for github
import { GithubProvider } from 'github-repository-provider';
const config = GithubProvider.optionsFromEnvironment(process.env);
const provider = new GithubProvider(config);
const repository = await provider.repository(`myuser/repo1`);
for async (const entry of repository.entries('\*_/_.md')) {
console.log(entry.name);
console.log(entry.string);
}Extends Branch
Branch on GitHub.
ownernameoptions
Writes content into the branch https://developer.github.com/v3/git/blobs/#get-a-blob
entryContentEntry
Returns Promise<ContentEntry> written content with sha values set
https://developer.github.com/v3/git/trees/#create-a-tree https://developer.github.com/v3/git/commits/#create-a-commit https://developer.github.com/v3/git/refs/#update-a-reference
https://developer.github.com/v3/repos/contents/#get-repository-content
namestring
Returns AsyncGenerator<ContentEntry> all matching entries in the branch
https://developer.github.com/v3/repos/contents/
entriesAsyncIterable<ContentEntry>
Extends RepositoryGroup
Represents github repo owner either
- users
- organization
https://developer.github.com/v3/repos/#create-a-repository-for-the-authenticated-user
Returns Promise<Repository> newly created repository
https://developer.github.com/v3/repos/#delete-a-repository
namestring
Extends MultiGroupProvider
GitHub provider. Lookup a repository. known environment variables
- GITHUB_TOKEN or GH_TOKEN api token
import GithubProvider from 'github-repository-provider';
const ghp = new GithubProvider();
const r1 = ghp.repository('git@github.com:arlac77/github-repository-provider.git');
const r2 = ghp.repository('git://github.com/arlac77/github-repository-provider.git');
const r3 = ghp.repository('git+ssh://github.com/arlac77/github-repository-provider.git');
const r4 = ghp.repository('https://github.com/arlac77/github-repository-provider.git#master');
const r5 = ghp.repository('git+https://github.com/arlac77/github-repository-provider.git#master');
const r6 = ghp.repository('arlac77/github-repository-provider');
// different ways to address the same repositoryhttps://developer.github.com/v3/repos/#list-repositories-for-the-authenticated-user
All possible base urls
- github:
- git@github.com
- git://github.com
- git+ssh://github.com
- https://github.com
- git+https://github.com
Returns Array<string> common base urls of all repositories
We are called github.
Returns string github
Returns string default environment name prefix for the provider instance
Extends PullRequest
Github pull request.
https://developer.github.com/v3/pulls/#merge-a-pull-request
method(optional, default"MERGE")
All valid merge methods.
Returns Set<string> valid merge methods
https://developer.github.com/v3/pulls/#list-pull-requests
repositoryRepositoryfilterObject (optional, default{})
https://developer.github.com/v3/pulls/#create-a-pull-request
sourceBranchdestinationBranchoptionsObject?
Extends Repository
Repository on GitHub.
https://docs.github.com/en/rest/reference/commits#list-commits
optionsObject
Returns AsyncIterable<Commit>
https://developer.github.com/v3/git/commits/#get-a-commit
shastring
Returns Promise<Object> response
shastring
Returns Promise<Array<Object>>
Returns Promise<Object> newly created tree
https://developer.github.com/v3/repos/branches/#list-branches
https://docs.github.com/en/rest/reference/repos#list-repository-tags
Returns string github https url
Deliver the url of issue tracking system.
Returns string
Deliver the url of the repositories home page.
Returns string
API endpoint for ourselfs.
Returns string
https://docs.github.com/de/rest/repos/repos?apiVersion=2022-11-28#update-a-repository
Get sha of a ref. https://developer.github.com/v3/git/refs/
refstring
Returns Promise<string> sha of the ref
https://docs.github.com/en/github-ae@latest/rest/git/refs#update-a-reference
https://developer.github.com/v3/pulls/#update-a-pull-request
namestring
https://developer.github.com/v3/repos/hooks/
With npm do:
npm install github-repository-providerBSD-2-Clause