Skip to content

RichardLitt/add-file-to-github-repo

Repository files navigation

add-file-to-github-repo

Greenkeeper badge

Build Status standard-readme compliant

Add a file to a GitHub repository

Install

$ npm install --save add-file-to-github-repo

Usage

const addFileToGithubRepo = require('add-file-to-github-repo');

addFileToGithubRepo('unicorns', 'RichardLitt/here', {
  path: '.github/unicorns'
})
//=> 'Done'

API

addFileToGithubRepo(file, repository, [options])

file

Type: string

The file.

repo

Type: string

In the format 'user/repo'

options

branch

Type: string Default: master

The branch to commit to.

message

Type: string

The commit message. Default: chore(filename): init file.

path

Type: string

Where to save the file.

CLI

$ 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'

Contribute

PRs accepted. Check out the issues!

License

MIT © Richard Littauer

About

Add a file to a GitHub repository

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published