| 259 | } |
| 260 | |
| 261 | async function stepVerifyToken(client) { |
| 262 | const secret = need('RUNNING_SECRET'); |
| 263 | const org = await orgUuid(client); |
| 264 | const row = await client.query( |
| 265 | "SELECT encode(encrypted_installation_id,'hex') AS hex FROM github_app_installations WHERE organization_uuid=$1", [org]); |
| 266 | if (!row.rows.length) throw new Error('no installation row'); |
| 267 | const id = decrypt(Buffer.from(row.rows[0].hex, 'hex'), secret); |
| 268 | const res = await gh(`/app/installations/${id}/access_tokens`, { method: 'POST' }); |
| 269 | if (res.status === 201) console.log(`OK: installation token mints (id=${id}, HTTP 201)`); |
| 270 | else { console.error(`FAIL: verify-token -- POST access_tokens for id=${id} -> ${res.status}`); process.exit(1); } |
| 271 | } |
| 272 | |
| 273 | // A shared base snapshot bakes in the *creating* instance's warehouse host/port, so a |
| 274 | // bootstrapped instance points its local-postgres warehouse at a dead port and every |