Skip to content

Commit fb00785

Browse files
committed
Update README
1 parent a967738 commit fb00785

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ If the `branch` provided does not exist, the plugin will error. To automatically
1717
In addition, it accepts `changes` which is an array of objects containing a `message` and a `files` object
1818

1919
```javascript
20-
let { Octokit } = require("@octokit/rest");
21-
Octokit = Octokit.plugin(require("octokit-commit-multiple-files"));
20+
import { Octokit } from "@octokit/rest";
21+
import { CreateOrUpdateFiles } from "octokit-commit-multiple-files";
2222

23-
const octokit = new Octokit();
23+
const OctokitWithPlugin = Octokit.plugin(CreateOrUpdateFiles);
24+
25+
const octokit = new OctokitWithPlugin();
26+
27+
// Define your repository details
28+
const owner = "your-username";
29+
const repo = "your-repo";
30+
const branch = "main";
31+
const createBranch = false;
2432

2533
const commits = await octokit.createOrUpdateFiles({
2634
owner,
@@ -71,7 +79,7 @@ const commits = await octokit.createOrUpdateFiles({
7179
By default the plugin will append commits to an existing branch. If you want to reset the branch to the state of `base` before adding any changes, set `forkFromBaseBranch: true`:
7280

7381
```javascript
74-
const commits = await octokit.rest.repos.createOrUpdateFiles({
82+
const commits = await octokit.createOrUpdateFiles({
7583
owner,
7684
repo,
7785
branch,

0 commit comments

Comments
 (0)