Skip to content

Commit 048e5a9

Browse files
committed
👷 Improve ci script
1 parent 1f41bfc commit 048e5a9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/go-ossf-slsa3-publish.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ jobs:
3939
- id: checkout
4040
uses: actions/checkout@v4
4141
- id: ldflags
42+
shell: bash
4243
run: |
43-
echo "commit-date=$(git log -1 --date='format:%Y-%m-%d/%H.%M.%S' --pretty=%cd)" >> "$GITHUB_OUTPUT"
44-
echo "commit=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
45-
echo "version=$(git describe --tags --always --dirty | cut -c2-)" >> "$GITHUB_OUTPUT"
46-
echo "tree-state=$(if git diff --quiet; then echo "clean"; else echo "dirty"; fi)" >> "$GITHUB_OUTPUT"
44+
{
45+
echo "commit-date=$(git log -1 --date='format:%Y-%m-%d/%H.%M.%S' --pretty=%cd)"
46+
echo "commit=$(git rev-parse --short HEAD)"
47+
echo "version=$(git describe --tags --always --dirty | cut -c2-)"
48+
echo "tree-state=$(if git diff --quiet; then echo "clean"; else echo "dirty"; fi)"
49+
} >> "$GITHUB_OUTPUT"
4750
# ===================================================================================================================================
4851
# Prerequisite: Create a .slsa-goreleaser.yml in the root directory of your project.
4952
# See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file
@@ -63,7 +66,7 @@ jobs:
6366
with:
6467
go-version-file: go.mod
6568
config-file: .slsa-goreleaser/${{ matrix.os }}-${{ matrix.arch }}.yml
66-
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}}"
69+
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}}"
6770
# =======================================================================================================
6871
# Optional: For more options, see https://github.com/slsa-framework/slsa-github-generator#golang-projects
6972
# =======================================================================================================

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ qodana.yaml
2424

2525
# Go workspace file
2626
go.work
27+
28+
dist/

0 commit comments

Comments
 (0)