diff --git a/.husky/pre-commit b/.husky/pre-commit index 1bff6a10..c0ba6fb8 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +1 @@ -#!/bin/sh bun generate && bun lint && bun format && bun package && git add . diff --git a/bun.lockb b/bun.lockb index 0a052168..544af92d 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index f4eb385a..4cae9c09 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "@actions/github": "6.0.1", "@adobe/node-fetch-retry": "2.2.0", "@octokit/graphql-schema": "15.26.0", - "@octokit/rest": "21.1.1", "axios": "1.9.0", "bluebird": "3.7.2", "codeowners-utils": "1.0.2", @@ -59,7 +58,7 @@ "generate": "bun scripts/generate-helper-inputs.ts", "lint": "eslint --quiet --fix ./**/*.ts src/**/*.ts test/**/*.ts", "package": "ncc build --source-map --license licenses.txt", - "prepare": "husky install", + "prepare": "husky", "setup": "./scripts/dev-setup.sh", "test": "bun jest" } diff --git a/src/types/github.ts b/src/types/github.ts index 50c22d66..5e400887 100644 --- a/src/types/github.ts +++ b/src/types/github.ts @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { RestEndpointMethodTypes } from '@octokit/rest'; +import { RestEndpointMethodTypes } from '@octokit/plugin-rest-endpoint-methods/dist-types'; import { octokit } from '../octokit'; export type PipelineState = RestEndpointMethodTypes['repos']['createCommitStatus']['parameters']['state']; @@ -31,6 +31,7 @@ export type ProjectListResponse = RestEndpointMethodTypes['projects']['listForRe export type ColumnListResponse = RestEndpointMethodTypes['projects']['listColumns']['response']; export type ChecksUpdateConclusion = RestEndpointMethodTypes['checks']['update']['parameters']['conclusion']; export type MembersInOrg = RestEndpointMethodTypes['teams']['listMembersInOrg']['response']['data']; +export type MembersInOrgParams = RestEndpointMethodTypes['teams']['listMembersInOrg']['parameters']; export type GithubError = { status: number; diff --git a/test/utils/paginate-members-in-org.test.ts b/test/utils/paginate-members-in-org.test.ts index 0ab6e52a..6b84dd99 100644 --- a/test/utils/paginate-members-in-org.test.ts +++ b/test/utils/paginate-members-in-org.test.ts @@ -12,15 +12,14 @@ limitations under the License. */ import { paginateMembersInOrg } from '../../src/utils/paginate-members-in-org'; -import { MembersInOrg } from '../../src/types/github'; -import { RestEndpointMethodTypes } from '@octokit/rest'; +import { MembersInOrg, MembersInOrgParams } from '../../src/types/github'; jest.mock('@actions/github', () => ({ context: { repo: { repo: 'repo', owner: 'owner' } }, getOctokit: jest.fn(() => ({ rest: { teams: { - listMembersInOrg: jest.fn(async (args: RestEndpointMethodTypes['teams']['listMembersInOrg']['parameters']) => { + listMembersInOrg: jest.fn(async (args: MembersInOrgParams) => { let teamMembers: MembersInOrg = []; switch (args.team_slug) { case 'empty-team':