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

# Create or update GitHub workflow file

> Create or replace one GitHub Actions workflow file in a commit.

`github.createOrUpdateWorkflowFile` creates or replaces a YAML workflow file directly under `.github/workflows/`.

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

export default automation("Update GitHub workflow", () => {
  github.createOrUpdateWorkflowFile({
    branch: "main",
    commitMessage: "Update deployment workflow",
    contentBase64: "bmFtZTogRGVwbG95Cg==",
    owner: "SentsCo",
    path: ".github/workflows/deploy.yml",
    repository: "automate.ax",
  })
})
```

Provide a `.yml` or `.yaml` path directly under `.github/workflows/`, Base64-encoded `contentBase64`, and `commitMessage`. Add the existing blob `sha` when replacing a workflow. Optional `branch` defaults to the default branch; `author` and `committer` accept `{ name, email }`. Returns the commit `sha` and the workflow content `path` and `sha`. The action requires both Contents and Workflows write permissions.
