name: Setup sops (pinned)
description: Install a pinned sops release and verify its SHA-256.
inputs:
  version:
    default: v3.13.3
  sha256:
    default: e5bec3346a873ae91d871550f3e698c1aad962aff462a080e40f25fde17fef6b
runs:
  using: composite
  steps:
    - shell: bash
      env:
        SOPS_VERSION: ${{ inputs.version }}
        SOPS_SHA256: ${{ inputs.sha256 }}
      run: |
        set -euo pipefail
        tmp="$(mktemp -d)"
        curl -fsSL -o "$tmp/sops" \
          "https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux.amd64"
        echo "${SOPS_SHA256}  $tmp/sops" | sha256sum -c -
        sudo install -m 0755 "$tmp/sops" /usr/local/bin/sops
        rm -rf "$tmp"
        sops --version --disable-version-check
