We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc9ad27 commit 9e3f7e7Copy full SHA for 9e3f7e7
1 file changed
.github/workflows/nuget-publish.yml
@@ -48,11 +48,18 @@ jobs:
48
dotnet new tool-manifest
49
dotnet tool install CycloneDX
50
51
- - name: Generate SBOM
+ - name: Generate SBOM for latest tag on branch
52
run: |
53
git fetch --tags
54
- VERSION=$(git describe --tags --abbrev=0)
55
- echo "Latest tag: $VERSION"
+ BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
+ echo "Current branch: $BRANCH_NAME"
56
+
57
+ VERSION=$(git tag --merged $BRANCH_NAME --sort=-v:refname | head -n1)
58
+ if [ -z "$VERSION" ]; then
59
+ VERSION=$(git rev-parse --short HEAD)
60
+ fi
61
+ echo "Version for SBOM: $VERSION"
62
63
mkdir -p sbom/$VERSION
64
dotnet tool run dotnet-CycloneDX OpenCode/OpenCode.csproj -o sbom/$VERSION -f json
65
0 commit comments