JasonEtco / octokit-create-new-file

Creates a new file on a new branch and opens a new pull request.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

octokit-create-new-file

Creates a new file on a new branch and opens a new pull request.

Usage

const createNewFile = require('octokit-create-new-file')
const newPr = await createNewFile(octokit, {
  pr: {
    title: 'This is a new pull request',
    body: 'An extended description about this pull request.'
  },
  repo: {
    owner: 'Example',
    repo: 'Name'
  },
  commitMessage: 'Create a new file',
  file: {
    path: 'new-file.md',
    content: 'This is the content of the new file.'
  }
})

console.log(newPr)
// { number: 1, title: 'Example' }

About

Creates a new file on a new branch and opens a new pull request.


Languages

Language:JavaScript 100.0%