Skip to content

GitHub

GitHub hosts git repositories and the work around them: reviewing changes in pull requests, tracking issues, and running CI/CD with Actions.

Actions builds, tests and deploys on every push, using credentials kept in its secrets and variables. Environments guard production behind reviews. Webhooks tell other systems when something happens in a repository.

New to GitHub? Start with What is GitHub?.

A repository, with its settings kept in code:

alchemy.run.ts
const repo = yield* GitHub.Repository("api", { owner: "my-org", name: "api", autoInit: true });

Actions variables set from another resource’s outputs:

alchemy.run.ts
yield* GitHub.Variables({
owner: "my-org",
repository: "api",
variables: { AWS_ROLE_ARN: role.roleArn, AWS_REGION: region },
});

And one comment per pull request, updated on every deploy with the preview’s URL:

alchemy.run.ts
yield* GitHub.Comment("preview-comment", {
owner: "my-org",
repository: "api",
issueNumber: yield* Config.Number("PULL_REQUEST"),
body: Output.interpolate`Preview: ${website.url}`,
});

Want to build? Connect your token in Setup, then CI walks through a GitHub Actions workflow with a stage per pull request.

Looking for something specific? Every section of these docs is listed below, and every resource is in the generated API reference.