# Deploy approvals and notifications in GitHub Actions

> Pause a deploy until a person approves it from their phone, then tell everyone it shipped: realtime events for dashboards, push notifications for your app’s users, and waiting rooms opened on a schedule.

Source: https://hibira.io/guides/github-actions

Pause a deploy until a person approves it from their phone, then tell everyone it shipped: realtime events for dashboards, push notifications for your app’s users, and waiting rooms opened on a schedule.

Package: hibira-io/action@v1

- Approvals work in public and private repositories on every GitHub plan, and the approver needs no GitHub account.
- A rejected or unanswered request fails the step, so nothing ships without a yes.
- Deploy notifications as realtime events or push notifications, sent whether the job passed or failed.
- No dependencies: one step per command, with your app’s credentials in repository secrets.

## 1. Set it up

```shell
# Repository → Settings → Secrets and variables → Actions
# Variables: HIBIRA_APP_ID, HIBIRA_APP_KEY
# Secret:    HIBIRA_APP_SECRET
```

## 2. Ask for approval before deploying

```yaml
- uses: hibira-io/action@v1
  with:
    command: approval
    app-id: ${{ vars.HIBIRA_APP_ID }}
    key: ${{ vars.HIBIRA_APP_KEY }}
    secret: ${{ secrets.HIBIRA_APP_SECRET }}
    host: https://ws.hibira.io
    title: Deploy ${{ github.ref_name }} to production?
    timeout-minutes: 30
- run: ./deploy.sh
```

## 3. Send a deploy notification

```yaml
- if: always()
  uses: hibira-io/action@v1
  with:
    command: event
    app-id: ${{ vars.HIBIRA_APP_ID }}
    key: ${{ vars.HIBIRA_APP_KEY }}
    secret: ${{ secrets.HIBIRA_APP_SECRET }}
    host: https://ws.hibira.io
    channel: deploys
    event: deploy.finished
    data: '{"version":"${{ github.ref_name }}","status":"${{ job.status }}"}'
```

## 4. Open a waiting room on a schedule

```yaml
on:
  schedule:
    - cron: '0 1 * * 5'
jobs:
  open:
    runs-on: ubuntu-latest
    steps:
      - uses: hibira-io/action@v1
        with:
          command: waiting-room
          app-id: ${{ vars.HIBIRA_APP_ID }}
          key: ${{ vars.HIBIRA_APP_KEY }}
          secret: ${{ secrets.HIBIRA_APP_SECRET }}
          host: https://ws.hibira.io
          room: friday-drop
          state: open
          admit-per-minute: 200
```

## Before you start

- The runner stays busy while it waits for an answer, so keep timeout-minutes close to how long an answer should take.
- command: push sends a push notification instead; it takes your app’s push instance ID and secret key, from the app page under Push notifications.
- Or give api-token, an API token from Settings → AI agents with read and write access, instead of key and secret: every command then needs only app-id, push included.

## Frequently asked questions

### Do approvals need a paid GitHub plan?

No. The step waits for an answer on a Hibira approval page, so it works in public and private repositories on every GitHub plan, and the approver signs in to nothing on GitHub.

### What happens when nobody answers?

The request expires after timeout-minutes and the step fails, unless you set fail-on-reject: false and check the status output yourself.

- [GitHub Marketplace](https://github.com/marketplace/actions/hibira-deploy-approvals)
- [GitHub](https://github.com/hibira-io/action)
