# Add zizmor to CI for Your GitHub Actions Workflows

Yes. An agent turns on zizmor in your workflow linting, fixes what it reports in every workflow, pins actions to commits and opens a PR with the clean run attached.

[Run this on Rush](https://cloud.getrush.ai/run/add-zizmor-to-ci/github-actions/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent reads every workflow and the linter that is supposed to check them. In a repository shaped like actions/typescript-action there are five: `ci.yml` (TypeScript tests, then a `test-action` job that runs the action with `uses: ./` and echoes `${{ steps.test-action.outputs.time }}` in a `run:` step), `check-dist.yml` (rebuilds `dist/` and fails on a diff), `codeql-analysis.yml` (CodeQL with `checks: write` and `security-events: write`), `licensed.yml` (`workflow_dispatch` only, `contents: write` at the top level, commits and pushes license files) and `linter.yml`, which runs `super-linter/super-linter/slim@v8` over the codebase with `VALIDATE_ALL_CODEBASE: true` and a list of validators switched off, one of which is `VALIDATE_GITHUB_ACTIONS_ZIZMOR: false`. Every `uses:` in the repository is a tag, `actions/checkout@v6`, `actions/setup-node@v6`, `github/codeql-action/init@v4`, `ruby/setup-ruby@v1`; none is a commit. `.github/dependabot.yml` already updates `github-actions` weekly in a grouped pull request, and `actionlint.yml` at the root configures actionlint.

Then it runs zizmor itself over `.github/workflows` in the sandbox, the same tool super-linter would run, and reads the result before changing anything. On these five files the default audit reports twenty-five findings in four groups: `unpinned-uses` on all seventeen action references, because none is pinned to a commit hash; `artipacked` on the six `actions/checkout` steps that do not set `persist-credentials: false`; one `template-injection` on the `echo "${{ steps.test-action.outputs.time }}"` line in `ci.yml`; and one `self-repository` note on `uses: ./`. The pedantic persona adds `excessive-permissions` on `licensed.yml`'s top-level `contents: write` and on the `statuses: write` and `checks: write` grants, missing `concurrency` blocks, and undocumented permissions, which the agent lists but does not treat as blocking.

The fixes are mechanical and the agent makes them in every file rather than configuring the findings away. Each `uses:` becomes `owner/repo@<40-character sha> # vN`, with the comment Dependabot reads so its weekly group keeps updating the pin. Each `actions/checkout` gets `persist-credentials: false`, except in `licensed.yml`, where the job pushes a commit and needs the token; that one gets a `# zizmor: ignore[artipacked]` comment with the reason, the same inline syntax zizmor documents. The echoed output moves into an `env:` entry and the shell reads `"$TIME"`, so a value from a step can no longer be interpreted as code. `uses: ./` stays, since it is how a template action tests itself, with an inline ignore if the maintainers want a silent run. In `linter.yml` the `VALIDATE_GITHUB_ACTIONS_ZIZMOR: false` line is removed, so super-linter runs zizmor on every pull request from now on.

Before opening the pull request it re-runs zizmor to show zero findings in the default persona, runs `actionlint` with the repository's config to make sure the pinned references and `env:` changes parse, and runs `npm ci` and `npm run ci-test` so the TypeScript side is untouched. The description pastes the before and after zizmor summaries and lists the pedantic findings it left alone with a sentence each.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Enable zizmor for this repository's GitHub Actions workflows and open a pull request. Read every file under .github/workflows, .github/dependabot.yml and actionlint.yml first. Install zizmor in the sandbox and run it over .github/workflows in the default persona and again in the pedantic persona; keep both outputs. Fix every default-persona finding in place: pin each uses: reference to its full commit SHA with a version comment Dependabot can update, add persist-credentials: false to every actions/checkout step that does not push, and where a job must push, keep credentials and add an inline zizmor ignore comment with the reason; move any ${{ }} expression used inside a run: script into an env: entry and reference it as a shell variable; leave uses: ./ as it is unless an inline ignore is needed for a clean run. In linter.yml remove the line that disables the zizmor validator so super-linter runs it on every pull request. Re-run zizmor to show the default persona is clean, run actionlint with the repository config, and run npm ci and npm run ci-test. In the pull request description paste the before and after zizmor summaries, and list each pedantic finding you did not act on with one sentence of reasoning. Change nothing outside .github.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

What comes back is a pull request that touches the five workflow files and nothing else: seventeen `uses:` references pinned to commits with `# vN` comments, `persist-credentials: false` on five checkouts and a commented ignore on the sixth, the `echo` in `ci.yml` reading from `env:`, and `linter.yml` without the line that switched zizmor off. The description shows the zizmor output before the change, the clean run after it, the `actionlint` result and the passing `npm run ci-test`, plus the short list of pedantic-persona findings left for the maintainers.

The `Lint Codebase` workflow runs on the pull request with zizmor now enabled, so the first enforced run happens on the very change that enables it, next to the TypeScript tests and the `check-dist` job. Dependabot's next weekly `github-actions` group bumps the commit pins and their version comments together.

A reviewer checks that every SHA matches the tag in its comment, that `licensed.yml` is the only workflow still persisting credentials and says why, and whether to act on the pedantic items, `concurrency` blocks and the `contents: write` on the licensing job, in a follow-up.

## Run it on every repository in your organization

An organisation that owns many actions and workflows has the same five findings many times over. A `POST /o/{org}/sessions` with this prompt and one repository in `resources`, sent from the terminal for each repository, starts one run per repository; each reads its own workflows, pins its own references and opens its own pull request, with the laptop free the whole time. The sandbox parks with its disk when the turn ends, so a follow-up such as `also add concurrency blocks to every workflow` wakes it with zizmor installed and the files already in hand.

With a `webhook_url` on the API key, Rush posts `run.completed` or `run.failed` with the `session_url` for each run as it finishes, so the pull request links collect in one handler instead of in a dozen tabs.

## Why run it on Rush?

Workflow hardening is tedious in a particular way: seventeen references to look up, each one a tag to resolve to the right commit, six checkouts to think about, one of which must keep its token, and a linter that fails on the first try until all of it is done. The agent does the lookups and the edits in its own sandbox, runs zizmor after every pass until the default persona is clean, and keeps the before and after output in the run's record, so the reviewer reads a diff and two summaries rather than redoing the audit by hand.

It also keeps the fix durable. Pinning with a version comment is what lets Dependabot keep the pins moving, and removing the disable line in `linter.yml` is what makes the next unpinned action fail review on its own. The pull request leaves the repository in a state where the check runs without anyone remembering to run it.

## Frequently asked questions

### Will Dependabot still update actions once they are pinned to commits?

Yes. Dependabot updates a `uses: owner/repo@<sha> # vN` reference by moving the SHA and rewriting the comment together, and the repository already has a weekly `github-actions` group in `.github/dependabot.yml`. The agent writes the comments in that form so the pins keep moving.

### Why does one checkout keep persist-credentials?

`licensed.yml` commits updated license files and runs `git push`, which needs the token the checkout stores. The agent leaves that job's credentials on and adds a `# zizmor: ignore[artipacked]` comment with the reason, so the exception is visible in the file rather than hidden in a config.

### Does it fix the pedantic findings too?

It lists them with a sentence each but acts only on the default persona, which is what super-linter enforces. `concurrency` blocks, the top-level `contents: write` in the licensing job and undocumented permissions are reasonable follow-ups, and the pull request names them so the maintainers can choose.

### What about the template-injection finding?

The `echo "${{ steps.test-action.outputs.time }}"` line lets a step output be interpolated into shell. The agent moves the expression into `env: TIME: ${{ steps.test-action.outputs.time }}` and the script echoes `"$TIME"`, which prints the same value without the injection path.

### Does super-linter need any other change?

No. Removing `VALIDATE_GITHUB_ACTIONS_ZIZMOR: false` is enough, because super-linter runs every validator that is not explicitly disabled. The other disabled validators, such as the ESLint and JSON ones, are left exactly as they were.

## More GitHub Actions jobs

- [Fix "docker-compose: command not found" in GitHub Actions](https://getrush.ai/run/fix-docker-compose-command-not-found/github-actions/)
- [Fix a Failing check-dist Job in a TypeScript GitHub Action](https://getrush.ai/run/fix-failing-ci/github-actions/)
- [Fix "Node.js 20 actions are deprecated" Annotations in GitHub Actions Workflows](https://getrush.ai/run/fix-node-js-20-actions-are-deprecated/github-actions/)

## More jobs like this: Hand off a long task

- [Turn an Asana Task into a Pull Request for a Laravel App](https://getrush.ai/run/asana-task-to-pr/laravel/)
- [Turn an Asana Task into a Pull Request for a Next.js App](https://getrush.ai/run/asana-task-to-pr/nextjs/)
- [Convert React Class Components to Hooks](https://getrush.ai/run/convert-class-components-to-hooks/react/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
