Skip to content

Commit 9e3f7e7

Browse files
authored
Update nuget-publish.yml
UPdated SBOM
1 parent dc9ad27 commit 9e3f7e7

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/nuget-publish.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,18 @@ jobs:
4848
dotnet new tool-manifest
4949
dotnet tool install CycloneDX
5050
51-
- name: Generate SBOM
51+
- name: Generate SBOM for latest tag on branch
5252
run: |
5353
git fetch --tags
54-
VERSION=$(git describe --tags --abbrev=0)
55-
echo "Latest tag: $VERSION"
54+
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
55+
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+
5663
mkdir -p sbom/$VERSION
5764
dotnet tool run dotnet-CycloneDX OpenCode/OpenCode.csproj -o sbom/$VERSION -f json
5865

0 commit comments

Comments
 (0)