name: 'Build OPA'
description: 'Build OPA from source and add to PATH'

inputs:
  go-version-file:
    description: 'Path to .go-version file'
    required: false
    default: '.go-version'

runs:
  using: 'composite'
  steps:
    - name: Setup Go
      uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
      with:
        go-version-file: ${{ inputs.go-version-file }}

    - name: Build OPA
      shell: bash
      run: go install .