From 4cd7d00edf057c62822df0b68817cfdf5c176c22 Mon Sep 17 00:00:00 2001 From: chaoqun <27287694+OpenWaygate@users.noreply.github.com> Date: Tue, 26 Mar 2024 22:37:55 +0800 Subject: [PATCH] :construction_worker: Read go version for go.mod --- .github/workflows/go-ossf-slsa3-publish.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go-ossf-slsa3-publish.yml b/.github/workflows/go-ossf-slsa3-publish.yml index d0df394..4717853 100644 --- a/.github/workflows/go-ossf-slsa3-publish.yml +++ b/.github/workflows/go-ossf-slsa3-publish.yml @@ -39,7 +39,7 @@ jobs: fetch-depth: 0 - id: ldflags run: | - echo "commit-date=$(git log --date=iso8601-strict -1 --pretty=%cd)" >> "$GITHUB_OUTPUT" + echo "commit-date=$(git log --date=iso8601-strict -1 --pretty=%ct)" >> "$GITHUB_OUTPUT" echo "commit=$GITHUB_SHA" >> "$GITHUB_OUTPUT" echo "version=$(git describe --tags --always --dirty | cut -c2-)" >> "$GITHUB_OUTPUT" echo "tree-state=$(if git diff --quiet; then echo "clean"; else echo "dirty"; fi)" >> "$GITHUB_OUTPUT" @@ -57,10 +57,9 @@ jobs: matrix: os: [linux, windows, darwin] arch: [amd64, arm64] - uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v1.9.0 + uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v1.10.0 with: - go-version: 1.21.5 - private-repository: true + go-version-file: go.mod config-file: .slsa-goreleaser/${{ matrix.os }}-${{ matrix.arch }}.yml evaluated-envs: "MODULE_PATH:github.com/${{ github.repository }}, COMMIT_DATE:${{needs.args.outputs.commit-date}}, COMMIT:${{needs.args.outputs.commit}}, VERSION:${{needs.args.outputs.version}}, TREE_STATE:${{needs.args.outputs.tree-state}}" # =======================================================================================================