> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Get GitHub repository content

> Get a file or directory at a GitHub repository path.

`github.getRepositoryContent` reads a file, directory, symlink, or submodule through GitHub's Contents API. File results include GitHub's encoded content so your automation can use the bytes instead of only inspecting metadata.

```ts automations/read-github-file.automation.ts theme={null}
import { automation } from "automate.ax"
import { github } from "automate.ax/github"

export default automation("Read GitHub config", () => {
  const file = github.getRepositoryContent({
    owner: "SentsCo",
    path: "package.json",
    ref: "main",
    repository: "automate.ax",
  })
})
```

Provide `owner`, `repository`, and a repository-relative `path`; use `""` for the root directory. Optional `ref` accepts a branch, tag, or commit SHA and defaults to the default branch.

The result depends on `type`:

* A file returns `{ type: "file", path, sha, content, encoding }`. GitHub normally returns Base64 content.
* A symlink returns `{ type: "symlink", path, sha, target }`.
* A submodule returns `{ type: "submodule", path, sha, submodule_git_url }`.
* A directory returns an array of `{ type, path, sha }` entries.

Requires Contents read permission.
