name: build-sign-attest-and-hold

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: read
      packages: write
    steps:
      - uses: actions/checkout@v4
      - name: Build image
        run: |
          echo "build image here"
      - name: Install cosign
        uses: sigstore/cosign-installer@v3
      - name: Sign image digest
        run: |
          echo "cosign sign <image>@<digest>"
      - name: Attest provenance or test predicate
        run: |
          echo "cosign attest --predicate predicate.json <image>@<digest>"

  approval-gate:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: production
    steps:
      - name: Hold for environment approval
        run: echo "Approval should reference digest, evidence pack, and rollback plan"
