# Connect send.io with GitHub Actions

Install the send.io CLI on any GitHub Actions runner with send-io/setup-sendio, and send email from your pipelines.

Status: Live. Category: Developer tools.

## What it does

- `send-io/setup-sendio` installs the send.io CLI on a Linux, macOS or Windows runner and puts `sendio` on the path.
- It checks the release's checksum before it installs.
- It can pass your API key to later steps, masked, as `SENDIO_API_KEY`.

## How it helps

- **Tell the team about a deploy**: Send an email when a deploy finishes.
- **Keep templates in the repository**: Push your email templates to send.io from the pipeline.
- **Fail the job on a bounce**: With `--wait delivered`, the step fails if the email bounces.

## Inputs (4)

- `version`: the sendio version to install. The default is `latest`.
- `api-key`: exported, masked, as `SENDIO_API_KEY` for later steps.
- `repo`: the GitHub repository that hosts the sendio releases. The default is `send-io/cli`.
- `github-token`: used to look up the latest release. The default is the job's token.

## Outputs (2)

- `version`: the installed version.
- `path`: the path of the binary.

## Connect in 3 steps

### 1. Store your API key

Create a key on the [API keys](https://app.send.io/integrations/api-keys) page and store it as the repository secret `SENDIO_API_KEY`.

### 2. Add the action to a workflow

The action installs `sendio` and exports the key for the steps after it.

`.github/workflows/notify.yml`

```text
- uses: send-io/setup-sendio@v1
  with:
    api-key: ${{ secrets.SENDIO_API_KEY }}
```

### 3. Run a command

Every later step can call the CLI.

```text
- run: sendio --version
```

## Inside send.io

Email a pipeline sends shows up in the console like any other email.

## Outside send.io

In any GitHub Actions workflow, on Linux, macOS or Windows runners (x64 or ARM64).

## Example workflows

### Email the team when a deploy finishes

`--wait delivered` fails the step if the email bounces.

```text
on:
  push:
    branches: [main]

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - uses: send-io/setup-sendio@v1
        with:
          api-key: ${{ secrets.SENDIO_API_KEY }}
      - run: |
          sendio emails send \
            --from "Deploys <deploys@yourdomain.com>" \
            --to team@yourdomain.com \
            --subject "Deployed ${GITHUB_SHA::7}" \
            --text "${GITHUB_REPOSITORY} at ${GITHUB_SHA} was deployed by ${GITHUB_ACTOR}." \
            --wait delivered
```

### Keep email templates in the repository

Push the templates in `./emails` on every run.

```text
- uses: actions/checkout@v4
- uses: send-io/setup-sendio@v1
  with:
    api-key: ${{ secrets.SENDIO_API_KEY }}
- run: sendio templates push ./emails
```

## Works well with

- [CLI](https://app.send.io/docs/integrations/cli)
- [Agent skills](https://app.send.io/docs/integrations/agent-skills)

## Questions and answers

**Is it on the GitHub Marketplace?**

Not yet. Use it by name: `send-io/setup-sendio@v1`.

**Which runners does it support?**

Linux, macOS and Windows, x64 or ARM64.

**Which version of the CLI does it install?**

The latest release, unless you set `version`.
