Skip to content

Commit 3509d8e

Browse files
authored
Allow Octokit instances with plugins to be provided (#131)
1 parent 701f6c0 commit 3509d8e

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

create-or-update-files.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function isBase64(str: string | Buffer): boolean {
5757
}
5858

5959
export default function (
60-
octokit: Octokit,
60+
octokit: Octokit | any,
6161
opts: Options,
6262
): Promise<CommitResult> {
6363
return new Promise(async (resolve, reject) => {
@@ -295,7 +295,7 @@ export default function (
295295
}
296296

297297
async function fileExistsInRepo(
298-
octokit: Octokit,
298+
octokit: Octokit | any,
299299
owner: string,
300300
repo: string,
301301
path: string,
@@ -316,7 +316,7 @@ async function fileExistsInRepo(
316316
}
317317

318318
async function createCommit(
319-
octokit: Octokit,
319+
octokit: Octokit | any,
320320
owner: string,
321321
repo: string,
322322
committer: RestEndpointMethodTypes["git"]["createCommit"]["parameters"]["committer"],
@@ -339,7 +339,7 @@ async function createCommit(
339339
}
340340

341341
async function createTree(
342-
octokit: Octokit,
342+
octokit: Octokit | any,
343343
owner: string,
344344
repo: string,
345345
treeItems: Array<
@@ -358,7 +358,7 @@ async function createTree(
358358
}
359359

360360
async function createBlob(
361-
octokit: Octokit,
361+
octokit: Octokit | any,
362362
owner: string,
363363
repo: string,
364364
contents: string | Buffer,
@@ -390,7 +390,7 @@ async function createBlob(
390390
}
391391

392392
async function loadRef(
393-
octokit: Octokit,
393+
octokit: Octokit | any,
394394
owner: string,
395395
repo: string,
396396
ref: string,

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Octokit } from "@octokit/rest";
22

33
import createOrUpdateFilesPlugin from "./create-or-update-files";
44

5-
export default function (octokit: Octokit) {
5+
export default function (octokit: Octokit | any) {
66
return {
77
createOrUpdateFiles: createOrUpdateFilesPlugin.bind(null, octokit),
88
};

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"description": "Octokit plugin to create/update multiple files at once",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
7+
"files": [
8+
"dist"
9+
],
710
"scripts": {
811
"build": "tsc",
912
"test": "npm run build && jest",
@@ -36,4 +39,4 @@
3639
"peerDependencies": {
3740
"@octokit/rest": ">=20.0.1"
3841
}
39-
}
42+
}

0 commit comments

Comments
 (0)