0.0.0-20230725134733 • Published 10 months ago

tinacms-provider-github v0.0.0-20230725134733

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

he Github Git Provider handles saving and deleting content to github. It can be used as a prop to the createDatabase function.

Adding the Github Git Provider

import { GithubProvider } from 'tinacms-provider-github'
// database.{ts,js}
//...

export default isLocal ? createLocalDatabase() ? createDatabase({
    gitProvider: new GitHubProvider({
        branch: process.env.GITHUB_BRANCH,
        owner: process.env.GITHUB_OWNER,
        repo: process.env.GITHUB_REPO,
        token: process.env.GITHUB_PERSONAL_ACCESS_TOKEN,
      }),,
    // ...
})

Github Git Provider Options

Required Options

OptionDescription
branchThe branch to save content to.
ownerThe owner of the repo.
repoThe repo to save content to.
tokenA Github Personal Access Token.

Optional Options

OptionDescription
commitMessageThe commit message to use when saving content. Defaults to Edited with TinaCMS.
rootPathThis path will be prefixed to all paths (good for monorepos)
octokitOptionsOptions passed to the Octokit constructor