Add a file to a GitHub repository
$ npm install --save add-file-to-github-repo
const addFileToGithubRepo = require('add-file-to-github-repo');
addFileToGithubRepo('unicorns', 'RichardLitt/here', {
path: '.github/unicorns'
})
//=> 'Done'
Type: string
The file.
Type: string
In the format 'user/repo'
Type: string
Default: master
The branch to commit to.
Type: string
The commit message. Default: chore(filename): init file.
Type: string
Where to save the file.
$ npm install --global add-file-to-github-repo
$ add-file-to-github-repo --help
Usage
$ add-file-to-github-repo [file] [repo] <opts>
Options
-b, --branch GitHub branch [Default: default_branch of repo]
-i, --input Input file path
-r, --repo Repository. Format: 'user/repo'
-m, --message Commit message [Default: chore(filename): init file]
-p, --path Where to put the file
Examples
$ GITHUB_TOKEN=abc... add-file-to-github-repo 'file' 'RichardLitt/add-file-to-github-repo'
PRs accepted. Check out the issues!