Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
maruel opened this issue Sep 13, 2023 · 1 comment
Labels
area:go Issue related to the Go ecosystem type:bug Something isn't working

Comments

@maruel
Copy link

maruel commented Sep 13, 2023

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/builder_go_slsa3.yml@v1.9.0
    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 maruel added status:triage Issue that has not been triaged type:bug Something isn't working labels Sep 13, 2023
@laurentsimon laurentsimon added area:go Issue related to the Go ecosystem and removed type:bug Something isn't working status:triage Issue that has not been triaged labels Sep 13, 2023
@ianlewis
Copy link
Member

Related to #63

@ianlewis ianlewis added the type:bug Something isn't working label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:go Issue related to the Go ecosystem type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants