octokit-plugin-search-and-replace-pull-request
v1.0.0
Published
Octokit plugin to replace a term across all repository files via a pull request
Downloads
3
Readme
octokit-plugin-search-and-replace-pull-request
Octokit plugin to replace a term across all repository files via a pull request
Usage
Browsers
Load octokit-plugin-search-and-replace-pull-request
and @octokit/core
(or core-compatible module) directly from cdn.pika.dev
<script type="module">
import { Octokit } from "https://cdn.pika.dev/@octokit/core";
import { searchAndReplacePullRequest } from "https://cdn.pika.dev/octokit-plugin-search-and-replace-pull-request";
</script>
Node
Install with npm install @octokit/core octokit-plugin-search-and-replace-pull-request
. Optionally replace @octokit/core
with a compatible module
const { Octokit } = require("@octokit/core");
const {
searchAndReplacePullRequest,
} = require("octokit-plugin-search-and-replace-pull-request");
octokit.createSearchAndReplacePullRequest({
owner: "octocat",
repo: "hello-world",
title: "pull request title",
body: "pull request description",
base: "master" /* optional: defaults to default branch */,
head: "rename-master-to-main",
terms: [
{
search: "master",
replace: "main",
},
],
});
One commit is created for every term. If there are no matches at all, an empty commit is created.
Contributing
See CONTRIBUTING.md