4.2.0 • Published 9 years ago

github-change-remote-file v4.2.0

Weekly downloads
59
License
MIT
Repository
github
Last release
9 years ago

github-change-remote-file

Build StatusCoverage StatusDependency StatusdevDependency Statusjs-standard-style

This module allows you to change a single file in a repository on GitHub and create a new commit or pull-request from that change. This has little to no overhead, because it doesn't work with a local copy of the git repository – everything is done via the GitHub API.

Examples

Create a new branch and commit on top of it:

githubChangeRemoteFile({
  user: 'boennemann',
  repo: 'animals',
  filename: 'package.json',
  newBranch: 'upgrade-standard',
  transform: pkg => {
    const parsedPkg = JSON.parse(pkg)
    pkg.devDependencies.standard = semver.inc(parsedPkg.devDependencies.standard, 'major')
    return JSON.stringify(parsedPkg, null, 2)
  },
  token: '<github access token with sufficent rights>'
})
.then(res => console.log(res))
.catch(console.log)

Create a new commit and push it on top of the (master) branch:

githubChangeRemoteFile({
  user: 'boennemann',
  repo: 'animals',
  filename: 'package.json',
  transform: pkg => {
    const parsedPkg = JSON.parse(pkg)
    pkg.devDependencies.standard = semver.inc(parsedPkg.devDependencies.standard, 'major')
    return JSON.stringify(parsedPkg, null, 2)
  },
  token: '<github access token with sufficent rights>'
})
.then(res => console.log(res))
.catch(console.log)
4.2.0

9 years ago

4.1.0

9 years ago

4.0.0

9 years ago

3.2.2

9 years ago

3.2.1

9 years ago

3.2.0

9 years ago

3.1.0

10 years ago

3.0.1

10 years ago

3.0.0

10 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago