@artsy/update-repo
v0.6.0
Published
Update repositories easily from a node script
Downloads
3,645
Keywords
Readme
@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:
- A
GH_TOKEN
environment variable which has permissions to create a PR to the repo you want to update. - A git installation with
user.email
anduser.name
configured or the equivalent environment variables
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!