Deploy checks

After each deploy, Barbwire sends the same personas to your site again, so you see what the deploy fixed or broke. Each persona counts as one run.

1. Make a token

Your CI sends it to prove the call comes from you. Keep it in your CI secrets. It works until you revoke it.

Only the owner makes tokens. Ask them for one.

2. Save the token in GitHub

GitHub keeps it secret and hands it to the workflow.

  1. In your repository, open Settings, then Secrets and variables, then Actions.
  2. Click New repository secret.
  3. Name it , paste the token as the value, and click Add secret.

3. Add the workflow

Save this file as .github/workflows/barbwire.yml and push it. After each production deploy that Vercel, Netlify or another GitHub integration reports, your personas go in. The tag names the deploy in your runs.

Test the site this repository deploys first. Then it shows up here and in the workflow.

# Sends your Barbwire personas to example.com after each successful production deploy.
name: Barbwire deploy check

on:
  deployment_status:
  workflow_dispatch:

jobs:
  barbwire:
    # To check previews too, drop the environment condition. Each persona counts as one run.
    if: github.event_name == 'workflow_dispatch' || (github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'production')
    runs-on: ubuntu-latest
    steps:
      - name: Send the personas
        env:
          BARBWIRE_TOKEN: ${{ secrets.BARBWIRE_TOKEN }}
          URL: ${{ github.event.deployment_status.environment_url }}
          TAG: ${{ github.ref_name }}@${{ github.sha }}
        run: |
          curl -sS --fail-with-body -X POST /api/hooks/deploy \
            -H "Authorization: Bearer $BARBWIRE_TOKEN" \
            -H "Content-Type: application/json" \
            -d "$(jq -n --arg site 'example.com' --arg tag "$TAG" --arg url "$URL" '{site: $site, tag: $tag, url: $url}')"

To try it now, open Actions in GitHub, pick Barbwire deploy check and click Run workflow.

Your workflow deploys by itself (Cloud Run, Fly, a script)? Add one step instead

Put it after your deploy step. Set URL to a preview address to check it first; any public address works.

- name: Check the deploy with Barbwire
  env:
    BARBWIRE_TOKEN: ${{ secrets.BARBWIRE_TOKEN }}
    URL: "" # or the address you just deployed to
    TAG: ${{ github.ref_name }}@${{ github.sha }}
  run: |
    curl -sS --fail-with-body -X POST /api/hooks/deploy \
      -H "Authorization: Bearer $BARBWIRE_TOKEN" \
      -H "Content-Type: application/json" \
      -d "$(jq -n --arg site 'example.com' --arg tag "$TAG" --arg url "$URL" '{site: $site, tag: $tag, url: $url}')"

4. Pick who goes

Each site sends up to 5 personas on a deploy. Until you pick, it sends the personas of its last test.

A deploy that is already on the site is not sent twice. When your runs are used up, the step fails with a message that says so.