diff --git a/src/helpers/github.ts b/src/helpers/github.ts index 68d1dff..155b05d 100644 --- a/src/helpers/github.ts +++ b/src/helpers/github.ts @@ -31,17 +31,13 @@ export async function getMergeTimeoutAndApprovalRequiredCount(context: Context, mergeTimeout: mergeTimeout?.collaborator, requiredApprovalCount: approvalsRequired?.collaborator, }; - const timeoutContributor = { - mergeTimeout: mergeTimeout?.contributor, - requiredApprovalCount: approvalsRequired?.contributor, - }; /** * Hardcoded roles here because we need to determine the timeouts * separate from `allowedReviewerRoles` which introduces * potential unintended user errors and logic issues. */ - return ["COLLABORATOR", "MEMBER", "OWNER"].includes(authorAssociation) ? timeoutCollaborator : timeoutContributor; + return ["COLLABORATOR", "MEMBER", "OWNER"].includes(authorAssociation) ? timeoutCollaborator : null; } export async function getApprovalCount({ octokit, logger, config: { allowedReviewerRoles } }: Context, { owner, repo, issue_number: pullNumber }: IssueParams) { diff --git a/src/types/plugin-inputs.ts b/src/types/plugin-inputs.ts index 10474e0..64be51a 100644 --- a/src/types/plugin-inputs.ts +++ b/src/types/plugin-inputs.ts @@ -21,11 +21,7 @@ export const mergeTimeoutSchema = T.Object( /** * The timespan to wait before merging a collaborator's pull-request, defaults to 3.5 days. */ - collaborator: T.String({ default: "3.5 days" }), - /** - * The timespan to wait before merging a contributor's pull-request, defaults to 7 days. - */ - contributor: T.String({ default: "7 days" }), + collaborator: T.String({ default: "3.5 days", description: "The timespan to wait before merging a collaborator's pull-request" }), }, { default: {} } ); diff --git a/tests/main.test.ts b/tests/main.test.ts index db3ea65..8150235 100644 --- a/tests/main.test.ts +++ b/tests/main.test.ts @@ -151,10 +151,7 @@ describe("Action tests", () => { { once: true } ) ); - await expect(githubHelpers.getMergeTimeoutAndApprovalRequiredCount(context, "CONTRIBUTOR")).resolves.toEqual({ - mergeTimeout: contributorMergeTimeout, - requiredApprovalCount: contributorMinimumApprovalsRequired, - }); + await expect(githubHelpers.getMergeTimeoutAndApprovalRequiredCount(context, "CONTRIBUTOR")).resolves.toEqual(null); }); it("Should check if the CI tests are all passing", async () => {