Skip to content

Commit 158a769

Browse files
committed
fix for sbom generation
1 parent 9910c6a commit 158a769

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release | Build Binary
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77
workflow_dispatch:
88

99
env:
@@ -13,43 +13,41 @@ env:
1313
SUPPLIER_URL: https://interlynk.io
1414
PYLYNK_TEMP_DIR: $RUNNER_TEMP/pylynk
1515
SBOM_TEMP_DIR: $RUNNER_TEMP/sbom
16-
SBOM_ENV: development
1716
SBOM_FILE_PATH: $RUNNER_TEMP/sbom/_manifest/spdx_2.2/manifest.spdx.json
1817
MS_SBOM_TOOL_URL: https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64
1918
MS_SBOM_TOOL_EXCLUDE_DIRS: "**/samples/**"
2019

21-
2220
jobs:
2321
releaser:
2422
runs-on: ubuntu-latest
2523
permissions:
2624
id-token: write
2725
contents: write
2826
steps:
29-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v3
3028
with:
3129
fetch-depth: 0
32-
- run: git fetch --force --tags
30+
- run: git fetch --force --tags
3331
- uses: actions/setup-go@v3
3432
with:
35-
go-version: '>=1.20'
33+
go-version: ">=1.20"
3634
check-latest: true
3735
cache: true
38-
36+
3937
- name: Get Tag
4038
id: get_tag
4139
run: echo "LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo 'v0.0.1')" >> $GITHUB_ENV
42-
40+
4341
- name: Goreleaser
4442
uses: goreleaser/goreleaser-action@v4
4543
with:
4644
install-only: true
4745

4846
- run: go version
49-
- run: goreleaser -v
50-
47+
- run: goreleaser -v
48+
5149
- name: Releaser
52-
run: make release
50+
run: make release
5351
env:
5452
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5553

@@ -60,10 +58,8 @@ jobs:
6058
mkdir -p ${{ env.SBOM_TEMP_DIR}}
6159
curl -Lo $RUNNER_TEMP/sbom-tool ${{ env.MS_SBOM_TOOL_URL }}
6260
chmod +x $RUNNER_TEMP/sbom-tool
63-
SANITIZED_REF=$(echo "${{ github.ref_name}}" | sed -e 's/[^a-zA-Z0-9.-]/-/g' -e 's/^[^a-zA-Z0-9]*//g')
64-
VERSION= ${{ env.LATEST_TAG }}-$SANITIZED_REF
65-
$RUNNER_TEMP/sbom-tool generate -b ${{ env.SBOM_TEMP_DIR }} -bc . -pn ${{ env.TOOL_NAME }} -pv $VERSION -ps ${{ env.SUPPLIER_NAME}} -nsb ${{ env.SUPPLIER_URL }} -cd "--DirectoryExclusionList ${{ env.MS_SBOM_TOOL_EXCLUDE_DIRS }}"
66-
61+
$RUNNER_TEMP/sbom-tool generate -b ${{ env.SBOM_TEMP_DIR }} -bc . -pn ${{ env.TOOL_NAME }} -pv ${{ env.LATEST_TAG }} -ps ${{ env.SUPPLIER_NAME}} -nsb ${{ env.SUPPLIER_URL }} -cd "--DirectoryExclusionList ${{ env.MS_SBOM_TOOL_EXCLUDE_DIRS }}"
62+
6763
- name: Upload SBOM as Release Asset
6864
uses: actions/upload-release-asset@v1
6965
with:

0 commit comments

Comments
 (0)