File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,21 +50,23 @@ jobs:
5050
5151 - name : Generate SBOM
5252 run : |
53- # Get version from tag
54- VERSION=${GITHUB_REF#refs/tags/}
53+ git fetch --tags
54+ VERSION=$(git describe --tags --abbrev=0)
55+ echo "Latest tag: $VERSION"
5556 mkdir -p sbom/$VERSION
5657 dotnet tool run dotnet-CycloneDX OpenCode/OpenCode.csproj -o sbom/$VERSION -f json
57-
58- - name : Commit SBOM to repository
58+
59+ - name : Commit SBOM
5960 env :
6061 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6162 run : |
62- VERSION=${GITHUB_REF#refs/ tags/}
63+ VERSION=$(git describe -- tags --abbrev=0)
6364 git config user.name "github-actions[bot]"
6465 git config user.email "github-actions[bot]@users.noreply.github.com"
6566 git add sbom/$VERSION/bom.json
6667 git commit -m "Add SBOM for version $VERSION" || echo "No changes to commit"
67- git push origin HEAD:${GITHUB_REF_NAME:-main}
68+ git push origin HEAD
69+
6870
6971 - name : Pack
7072 if : matrix.dotnet-version == '9.x'
You can’t perform that action at this time.
0 commit comments