@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
md 57 lines 1.59 KB
Rendered Raw
1 # @alchemy.run/github
2
3 GitHub for [Alchemy](https://alchemy.run). Declare repositories, Actions secrets and variables, environments, webhooks, and branch protection in the same TypeScript program as the infrastructure your CI deploys.
4
5 ```sh
6 npm install alchemy @alchemy.run/github effect
7 ```
8
9 A repository, with the variables its deploy workflow needs:
10
11 ```typescript
12 // alchemy.run.ts
13 import * as Alchemy from "alchemy";
14 import * as GitHub from "@alchemy.run/github";
15 import * as Effect from "effect/Effect";
16
17 export default Alchemy.Stack(
18 "MyRepos",
19 {
20 providers: GitHub.providers(),
21 state: Alchemy.localState(),
22 },
23 Effect.gen(function* () {
24 const repo = yield* GitHub.Repository("api", {
25 owner: "my-org",
26 name: "api",
27 description: "API service",
28 autoInit: true,
29 deleteBranchOnMerge: true,
30 });
31
32 yield* GitHub.Variables({
33 owner: "my-org",
34 repository: "api",
35 variables: { AWS_REGION: "us-east-1" },
36 });
37
38 yield* GitHub.Environment("production", {
39 owner: "my-org",
40 repository: "api",
41 name: "production",
42 reviewers: { teams: ["platform"] },
43 });
44
45 return { url: repo.htmlUrl };
46 }),
47 );
48 ```
49
50 Outputs from other providers flow straight in: pass a role ARN from `@alchemy.run/aws` as a variable, or an Axiom ingest token as a secret, and they stay in sync on every deploy.
51
52 ## Learn more
53
54 - [GitHub on alchemy.run](https://alchemy.run/github)
55 - [Setup](https://alchemy.run/github/setup)
56 - [Actions secrets and variables](https://alchemy.run/github/actions-config)
57 - [Repository events](https://alchemy.run/github/events)