artsy / update-repo

JS library for updating other repositories
MIT License
6 stars 1 forks source link

@artsy/update-repo

Update github repos with a pull request.

Installation

yarn add @artsy/update-repo

Usage

Aside from node, you need two things in your execution environment to make this work:

import { updateRepo } from "@artsy/update-repo"

await updateRepo({
  repo: { owner: "artsy", repo: "metaphysics" },
  branch: "update-npm-dependency",
  targetBranch: "main",
  title: "Update the version for my-npm-package",
  body: "bleep bloop :robot:",
  commitMessage: "update version",
  assignees: ["ds300"],
  labels: ["automated"],
  update: (dir) => {
    // This update function gets executed in a freshly-checked-out version
    // of the repo you specified. If you make any changes here they will
    // be committed and added to a PR.
    execSync(`yarn add my-npm-package@${newVersion}`, { cwd: dir })
  },
})

About Artsy

This project is the work of engineers at Artsy, the world's leading and largest online art marketplace and platform for discovering art. One of our core Engineering Principles is being Open Source by Default which means we strive to share as many details of our work as possible.

You can learn more about this work from our blog and by following @ArtsyOpenSource or explore our public data by checking out our API. If you're interested in a career at Artsy, read through our job postings!