name: setup-goversion
runs:
  using: composite
  steps:
    - id: goversion
      run: |
        cat Dockerfile | awk '/^FROM golang:.* AS build$/ {v=$2;split(v,a,":"); split(a[2],b,"@")}; END {printf("version=%s", b[1])}' >> $GITHUB_OUTPUT
      shell: bash
    - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
      with:
        go-version: "${{steps.goversion.outputs.version}}"
