# Connect GitHub Actions

> Let your agent do it: Add a Hermitbox step to my GitHub Actions workflow. Check that my install has an address the runner can reach; a hosted runner can't reach a loopback install. Have me set the repository Actions variable `HERMITBOX_API_URL` and the secret `HERMITBOX_API_KEY` myself, and set `HERMITBOX_IMAGE` to `alpine:3.22` only for the container tier. Then add the page's step to a job: it runs `echo hello` and deletes its sandbox. Never copy the key into the workflow or this chat. Follow the exact steps in https://docs.hermitbox.dev/v0.2.4/integrations/github-actions.md.

Run a command in a Hermitbox sandbox from a GitHub Actions workflow step. The Action creates
the sandbox, runs the command and deletes the sandbox.

1. Host Hermitbox at an address your Actions runner can reach; hosted runners cannot reach a private loopback install.
2. Set repository Actions variable `HERMITBOX_API_URL` and secret `HERMITBOX_API_KEY`. Set variable
   `HERMITBOX_IMAGE` to `alpine:3.22` for containers; leave it empty for process or Wasm.
3. Put this step in a workflow job. The Action runs `echo hello` and deletes its sandbox.

```yaml
- uses: hermitbox/hermitbox/action@v0.2.4
  with:
    url: ${{ vars.HERMITBOX_API_URL }}
    key: ${{ secrets.HERMITBOX_API_KEY }}
    image: ${{ vars.HERMITBOX_IMAGE }}
    run: echo hello
```

The Action's tag follows the repository's release version. Images need the container tier. An
empty image selects the host's default tier and never substitutes a weaker isolation. See the
[Action inputs](https://github.com/hermitbox/hermitbox/blob/c61777fdb140d97cded5ef039bce3a7e7c7a2a18/action/action.yml) and [tier boundaries](https://docs.hermitbox.dev/v0.2.4/reference/tiers.md).
