Update github repos with a pull request.
yarn add @artsy/update-repo
Aside from node, you need two things in your execution environment to make this work:
GH_TOKEN
environment variable which has permissions to create a PR to the repo you want to update.user.email
and user.name
configured or the equivalent environment variablesimport { 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 })
},
})
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!