File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020permissions : read-all
2121
2222jobs :
23+
24+ # Generate ldflags dynamically.
25+ # Optional: only needed for ldflags.
26+ args :
27+ runs-on : ubuntu-latest
28+ outputs :
29+ commit-date : ${{ steps.ldflags.outputs.commit-date }}
30+ commit : ${{ steps.ldflags.outputs.commit }}
31+ version : ${{ steps.ldflags.outputs.version }}
32+ tree-state : ${{ steps.ldflags.outputs.tree-state }}
33+ steps :
34+ - id : checkout
35+ uses : actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # tag=v2.3.4
36+ with :
37+ fetch-depth : 0
38+ - id : ldflags
39+ run : |
40+ echo "commit-date=$(git log --date=iso8601-strict -1 --pretty=%ct)" >> "$GITHUB_OUTPUT"
41+ echo "commit=$GITHUB_SHA" >> "$GITHUB_OUTPUT"
42+ echo "version=$(git describe --tags --always --dirty | cut -c2-)" >> "$GITHUB_OUTPUT"
43+ echo "tree-state=$(if git diff --quiet; then echo "clean"; else echo "dirty"; fi)" >> "$GITHUB_OUTPUT"
44+
2345 # ========================================================================================================================================
2446 # Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project.
2547 # See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file
You can’t perform that action at this time.
0 commit comments