github-change-remote-file icon indicating copy to clipboard operation
github-change-remote-file copied to clipboard

Can this create Pull Requests?

Open zeke opened this issue 9 years ago • 5 comments

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!

zeke avatar Nov 19 '16 05:11 zeke

bump :)

revolunet avatar Jan 15 '18 22:01 revolunet

Maybe @gr2m knows something about this...

zeke avatar Jan 16 '18 04:01 zeke

I don’t know about this particular library I’m afraid, I have creating an "Octokit Cookbook" in my backlog and creating a PR would probably a good candidate to start with.

@revolunet What is your use case exactly? Would you need to distinguish between creating a branch on the main repo or creating a fork first?

gr2m avatar Jan 16 '18 06:01 gr2m

sorry to answer your question, I don’t think this library supports creating a pull request any longer. But you can change the files on a new branch and then create a pull request using node-github, see docs for github.pullRequests.create(): https://octokit.github.io/node-github/#api-pullRequests-create

gr2m avatar Jan 16 '18 06:01 gr2m

Would you need to distinguish between creating a branch on the main repo or creating a fork first?

My use case would involve forking. 🍴

If I find a nice tool that wraps up this functionality, I will share it here.

zeke avatar Jan 16 '18 17:01 zeke