Open History to see the last commit
1import * as Pulls from "@distilled.cloud/github/pulls";
2import * as Layer from "effect/Layer";
3import * as BindingHttp from "./BindingHttp.ts";
4import { MergePullRequest, type MergePullRequestRequest } from "./MergePullRequest.ts";
5
6export const mergePullRequestOperation = BindingHttp.operation(
7 "pulls.merge",
8 (repo) => (request: MergePullRequestRequest) =>
9 Pulls.merge({ owner: repo.owner, repo: repo.repository, ...request }),
10);
11
12/**
13 * Token-backed implementation of {@link MergePullRequest}. Provide it on a Worker or
14 * Function: it captures a `GitHub.PersonalAccessToken` for the host and binds
15 * the token and the repository into it.
16 *
17 * @layer
18 * @product Pull Request
19 * @provides GitHub.MergePullRequest
20 */
21export const MergePullRequestHttp = Layer.effect(
22 MergePullRequest,
23 BindingHttp.make(mergePullRequestOperation),
24);