This repository was archived by the owner on Mar 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +58
-19
lines changed Expand file tree Collapse file tree 6 files changed +58
-19
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ ID=custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-service-mesh
4+
5+ get_revision () {
6+ curl -s " https://app.fossa.com/api/revisions?projectId=${ID} " -H " Authorization: Bearer ${FOSSA_TOKEN} " | jq -ec " .[] | select(.locator | contains(\" ${COMMIT_SHA} \" ))"
7+ }
8+
9+ echo -n " waiting for revision ${COMMIT_SHA} to exist..."
10+ until get_revision > /dev/null; do
11+ sleep 10
12+ done
13+ echo " done"
14+
15+ REV_ID=" ${ID} %24${COMMIT_SHA} "
16+
17+ get_attributions () {
18+ curl -s " https://app.fossa.com/api/revisions/${REV_ID} /attribution/full/SPDX_JSON" -H " Authorization: Bearer ${FOSSA_TOKEN} "
19+ }
20+
21+ echo -n " waiting for attributions to be populated..."
22+ while
23+ OUTPUT=$( get_attributions)
24+ LEN=$( jq ' .packages | length' <<< " $OUTPUT" )
25+ [[ $LEN -le 1 ]]
26+ do
27+ sleep 10
28+ done
29+ echo " done"
30+
31+ echo $OUTPUT | jq > nsm.sbom.json
32+ echo " SBOM report generated"
Original file line number Diff line number Diff line change 44 push :
55 pull_request :
66
7- defaults :
8- run :
9- shell : bash
10-
117env :
128 HELM_CHART_DIR : helm-chart
139 GIT_NAME : NGINX Kubernetes Team
3531 version : v1.52
3632 args : --timeout 10m
3733 - name : Lint Helm
38- run : helm lint ${{ env.HELM_CHART_DIR }}
34+ run : helm lint ${{ env.HELM_CHART_DIR }}
3935
4036 unit-tests :
4137 name : Unit Tests
6864 go-version-file : go.mod
6965 cache : true
7066
71- - name : Download Syft
72- uses : anchore/sbom-action/download-syft@422cb34a0f8b599678c41b21163ea6088edb2624 # v0.14.1
73- if : startsWith(github.ref, 'refs/tags/')
74-
7567 - name : Build binary
7668 uses : goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
7769 with :
Original file line number Diff line number Diff line change 44 push :
55 pull_request :
66
7- defaults :
8- run :
9- shell : bash
10-
117concurrency :
128 group : ${{ github.ref_name }}-docs
139 cancel-in-progress : true
1410
11+ permissions :
12+ contents : read
13+
1514jobs :
1615 markdown-lint :
1716 name : Markdown Lint
Original file line number Diff line number Diff line change 55 branches :
66 - main
77 - release-*
8+ tags :
9+ - ' *'
810 paths-ignore :
911 - docs/**
1012 - examples/**
2123 scan :
2224 name : Fossa
2325 runs-on : ubuntu-22.04
26+ timeout-minutes : 30
2427 if : ${{ github.event.repository.fork == false }}
2528 steps :
2629 - name : Checkout Repository
2932 uses : fossas/fossa-action@f61a4c0c263690f2ddb54b9822a719c25a7b608f # v1.3.1
3033 with :
3134 api-key : ${{ secrets.FOSSA_TOKEN }}
35+ - name : Generate SBOM
36+ if : startsWith(github.ref, 'refs/tags/')
37+ env :
38+ COMMIT_SHA : ${{ github.sha }}
39+ FOSSA_TOKEN : ${{ secrets.FOSSA_TOKEN }}
40+ run : .github/scripts/generate-sbom.sh
41+ - name : Upload SBOM
42+ if : startsWith(github.ref, 'refs/tags/')
43+ uses : azure/CLI@fa0f960f00db49b95fdb54328a767aee31e80105 # v1.0.7
44+ env :
45+ AZURE_STORAGE_ACCOUNT : ${{ secrets.AZURE_STORAGE_ACCOUNT }}
46+ AZURE_STORAGE_KEY : ${{ secrets.AZURE_STORAGE_KEY }}
47+ with :
48+ inlineScript : |
49+ az storage blob upload -c ${{ secrets.AZURE_SBOM_BUCKET_NAME }} -f nsm.sbom.json \
50+ -n product/nginx-service-mesh/${{ github.ref_name }}/nginx-service-mesh-${{ github.ref_name }}.sbom.json
Original file line number Diff line number Diff line change 55 branches :
66 - main
77 - release-*
8+ tags :
9+ - ' *'
810 paths-ignore :
911 - docs/**
1012 - examples/**
Original file line number Diff line number Diff line change @@ -21,9 +21,6 @@ changelog:
2121checksum :
2222 name_template : checksums.txt
2323
24- sboms :
25- - artifacts : archive
26-
2724release :
2825 ids : [nginx-meshctl]
2926 header : |
@@ -34,13 +31,11 @@ release:
3431archives :
3532 - id : nginx-meshctl
3633 builds : [nginx-meshctl]
37- name_template : nginx-meshctl_{{ .Version }}_{{ .Os }}_{{ .Arch }}
34+ name_template : nginx-meshctl_{{.Version}}_{{.Os}}_{{.Arch}}
3835 format_overrides :
3936 - goos : windows
4037 format : zip
4138
4239blobs :
4340 - provider : azblob
4441 bucket : ' {{.Env.AZURE_BUCKET_NAME}}'
45- extra_files :
46- - glob : ./dist/**.sbom
You can’t perform that action at this time.
0 commit comments