Git Product home page Git Product logo

github-change-remote-file's People

Contributors

boennemann avatar christophwitzko avatar finnp avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

remy zeke masone p0wl

github-change-remote-file's Issues

Can this create Pull Requests?

Hi. The README used to have a section about creating pull requests: https://github.com/boennemann/github-change-remote-file/blob/8f55a5a13f974ad0a2b69939d55350f2fb36db16/README.md

The sample code looked like this. Note the pr stanza:

githubChangeRemoteFile({
  user: 'boennemann',
  repo: 'animals',
  filename: 'package.json'
  transform: function (pkg) {
    pkg = JSON.parse(pkg)
    pkg.devDependencies.standard = semver.inc(pkg.devDependencies.standard, 'major')
    return JSON.stringify(pkg)
  },
  token: '<github access token with sufficent rights>',
  pr: {
    title: 'Updated standard to latest version',
    body: 'whatever'
  }
}, function (err, res) {
  console.log(res.html_url) // url of the pr
})

It looks like that documentation (and functionality?) were removed. Is it still possible? If not, are you using a different package now to create PRs?

Thanks!

422: Validation Failed

I have the following code, derived from the README example:

require('dotenv').load()

const githubChangeRemoteFile = require('github-change-remote-file')

githubChangeRemoteFile({
  user: 'zeke',
  repo: 'standard-markdown',
  filename: 'package.json',
  transform: function (pkg) {
    pkg = JSON.parse(pkg)
    pkg.dependencies.standard = '100'
    return JSON.stringify(pkg, null, 2)
  },
  token: process.env.GITHUB_TOKEN,
  pr: {
    title: 'Testing automated PRs',
    body: 'This is a test. cc @zeke'
  }
}, function (err, res) {
  console.log(JSON.stringify(err, null, 2))
  console.log(JSON.stringify(res, null, 2))
})

When I run it, I'm getting a 422 back from GitHub.

❯ node index.js       
{
  "code": 422,
  "message": "{\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"PullRequest\",\"field\":\"head\",\"code\":\"invalid\"}],\"documentation_url\":\"https://developer.github.com/v3/pulls/#create-a-pull-request\"}"
}
undefined

I have verified that the GITHUB_TOKEN is being set, and it lots of privileges.

Am I missing something, @boennemann?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.