> ## 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.

# Delete GitHub repository file

> Delete one GitHub repository file in a commit.

`github.deleteRepositoryFile` deletes one file through GitHub's Contents API.

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

export default automation("Remove generated file", () => {
  github.deleteRepositoryFile({
    branch: "cleanup",
    commitMessage: "Remove generated report",
    owner: "SentsCo",
    path: "reports/old.json",
    repository: "automate.ax",
    sha: "existing-blob-sha",
  })
})
```

Provide the repository, file `path`, current blob `sha`, and `commitMessage`. Optional `branch` defaults to the default branch; `author` and `committer` accept `{ name, email }`. Returns `commit.sha` and `content: null`. Requires Contents write permission. GitHub rejects stale blob IDs and conflicting concurrent Contents API writes.

This action rejects paths under `.github/workflows/`. Use `github.deleteWorkflowFile` for workflow files so Automate.ax requests GitHub's additional Workflows write permission only when GitHub requires it.
