pgblame

Wiring Railway deploys → pgblame

Two ways depending on your Railway plan.

Option A: Railway native webhook (Pro+)

  1. In your Railway project: Settings → Webhooks → Create.
  2. URL:
    https://pgblame.com/v1/deploy/railway?token=<your-pgblame-project-token>
  3. Trigger: Deployment Succeeded.
  4. Save. Copy the signing secret Railway provides.
  5. In pgblame: Project settings → Webhook signing secrets → Railway.

Option B: Generic curl in a deploy command

Add to your railway.json:

{
  "deploy": {
    "startCommand": "your-app-start-command",
    "healthcheckPath": "/healthz",
    "preDeployCommand": [
      "curl -fsS -X POST \"https://pgblame.com/v1/deploy?token=${PGBLAME_TOKEN}\" -H 'Content-Type: application/json' -d \"{\\\"source\\\":\\\"railway\\\",\\\"ref\\\":\\\"${RAILWAY_GIT_BRANCH}\\\",\\\"commit_sha\\\":\\\"${RAILWAY_GIT_COMMIT_SHA}\\\"}\""
    ]
  }
}

Set PGBLAME_TOKEN in Railway's environment variables.

Verifying

Trigger a deploy. After ~30 seconds the deploy should appear on the Timeline. If not: check the token, check that pgblame has any data ingested (timeline is empty by design without snapshots), and check Railway's webhook logs.