slsa-github-generator icon indicating copy to clipboard operation
slsa-github-generator copied to clipboard

[bug] keys goos and goarch in .slsa-goreleaser.yml do not evaluate Go template

Open maruel opened this issue 2 years ago • 1 comments

Describe the bug While the example at https://github.com/slsa-framework/slsa-github-generator/tree/main/internal/builders/go#configuration-file shows that Go templates are evaluated in the key ldflags, this is not the case for keys goos and goarch.

To Reproduce Steps to reproduce the behavior:

Use this form in .slsa-goreleaser.yml:

goos: "{{.Env.GOOS}}"

Use this form in the github actions workflow:

jobs:
  build:
    (...)
    strategy:
      matrix:
        os:
          - darwin
          - linux
          - window
        arch:
          - amd64
          - arm64
    uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
    with:
      go-version: 1.21
      evaluated-envs: "GOOS:${{matrix.os}}, GOARCH:${{matrix.arch}}"  

Expected behavior A single .slsa-goreleaser.yml can be used even for cross-compiling.

maruel avatar Sep 13 '23 00:09 maruel

Related to #63

ianlewis avatar Sep 20 '23 05:09 ianlewis