Commitspark is a set of tools to manage structured data with Git through a GraphQL API.
This repository holds code for a Commitspark Git adapter that provides access to Git repositories hosted on GitHub.
Instantiate the adapter with createAdapter()
and then call setRepositoryOptions()
with GitHubRepositoryOptions
on
the instance. These options are as follows:
Option name | Required | Default value | Description |
---|---|---|---|
repositoryOwner |
True | GitHub repository owner, e.g. commitspark |
|
repositoryName |
True | GitHub repository name, e.g. git-adapter-github |
|
accessToken |
True | GitHub access token (see details below) | |
pathSchemaFile |
False | commitspark/schema/schema.graphql |
Path to schema file in repository |
pathEntryFolder |
False | commitspark/entries/ |
Path to folder for entries |
An accessToken
may be any one of the following types of tokens:
A personal access token
with repo
scope is required.
For read-only access, a fine-grained personal access token with the following repository permissions is sufficient:
Permission | Access |
---|---|
Contents | Read-only |
Metadata | Read-only |
For write-access, permissions must be as follows:
Permission | Access |
---|---|
Contents | Read and write |
Metadata | Read-only |
In both cases, ensure the fine-grained permissions you give actually apply to the repository you want to work with.
Access tokens for a user obtained from an OAuth app can be used in the same way (including permissions) as fine-grained personal access tokens.
The code in this repository is licensed under the permissive ISC license (see LICENSE).