mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
Phase 6 of the relay split: the relay's deploy/operate surface moves under cloud/ with 24 cloud-* workflows gated on ORCA_CLOUD_OPERATIONS_ENABLED, the Cloud SQL rollout lease action, the relay Terraform root (dual-accept identities for both repositories), scripts, docs, CODEOWNERS, and a terraform validate job in Cloud Verify.
21 lines
825 B
JavaScript
21 lines
825 B
JavaScript
// Who we claim to be on the lease object. Shared by main and the detached renewer so both agree
|
|
// on the holder key without re-deriving it from a different set of environment variables.
|
|
|
|
export function holderIdentity(explicitHolderKey) {
|
|
const repository = process.env.GITHUB_REPOSITORY ?? 'unknown'
|
|
const runId = process.env.GITHUB_RUN_ID ?? 'unknown'
|
|
const server = process.env.GITHUB_SERVER_URL ?? 'https://github.com'
|
|
const holderKey = explicitHolderKey || `${repository}/${runId}`
|
|
if (/[\r\n]/.test(holderKey)) {
|
|
throw new Error('holder-key must be single-line')
|
|
}
|
|
return {
|
|
holderKey,
|
|
repository,
|
|
workflow: process.env.GITHUB_WORKFLOW ?? 'unknown',
|
|
runId,
|
|
runUrl: `${server}/${repository}/actions/runs/${runId}`,
|
|
runAttempt: process.env.GITHUB_RUN_ATTEMPT ?? 'unknown'
|
|
}
|
|
}
|