name: Universal Buildchain Bootstrap

on:
  workflow_call:
    inputs:
      request-json:
        description: "Versioned exact-candidate request envelope"
        required: true
        type: string
      runtime-ref:
        description: Entry-owned runtime selection parameter.
        required: false
        type: string
        default: ""
      contract-lock:
        description: Entry-owned runtime selection parameter.
        required: false
        type: string
        default: ""
    outputs:
      runtime-sha:
        value: ${{ jobs.bootstrap.outputs.runtime-sha }}
      terminal-receipt-json:
        value: ${{ jobs.bootstrap.outputs.terminal-receipt-json }}
      terminal-receipt-root:
        value: ${{ jobs.bootstrap.outputs.terminal-receipt-root }}

permissions:
  contents: read

jobs:
  bootstrap:
    uses: kungfu-systems/buildchain/.github/workflows/public-ops-bootstrap.yml@v4
    with:
      request-json: ${{ inputs.request-json }}
      runtime-ref: ${{ inputs.runtime-ref }}
      contract-lock: ${{ inputs.contract-lock }}
    secrets: inherit
