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 4
4
push :
5
5
pull_request :
6
6
7
- defaults :
8
- run :
9
- shell : bash
10
-
11
7
env :
12
8
HELM_CHART_DIR : helm-chart
13
9
GIT_NAME : NGINX Kubernetes Team
35
31
version : v1.52
36
32
args : --timeout 10m
37
33
- name : Lint Helm
38
- run : helm lint ${{ env.HELM_CHART_DIR }}
34
+ run : helm lint ${{ env.HELM_CHART_DIR }}
39
35
40
36
unit-tests :
41
37
name : Unit Tests
68
64
go-version-file : go.mod
69
65
cache : true
70
66
71
- - name : Download Syft
72
- uses : anchore/sbom-action/download-syft@422cb34a0f8b599678c41b21163ea6088edb2624 # v0.14.1
73
- if : startsWith(github.ref, 'refs/tags/')
74
-
75
67
- name : Build binary
76
68
uses : goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
77
69
with :
Original file line number Diff line number Diff line change 4
4
push :
5
5
pull_request :
6
6
7
- defaults :
8
- run :
9
- shell : bash
10
-
11
7
concurrency :
12
8
group : ${{ github.ref_name }}-docs
13
9
cancel-in-progress : true
14
10
11
+ permissions :
12
+ contents : read
13
+
15
14
jobs :
16
15
markdown-lint :
17
16
name : Markdown Lint
Original file line number Diff line number Diff line change 5
5
branches :
6
6
- main
7
7
- release-*
8
+ tags :
9
+ - ' *'
8
10
paths-ignore :
9
11
- docs/**
10
12
- examples/**
21
23
scan :
22
24
name : Fossa
23
25
runs-on : ubuntu-22.04
26
+ timeout-minutes : 30
24
27
if : ${{ github.event.repository.fork == false }}
25
28
steps :
26
29
- name : Checkout Repository
29
32
uses : fossas/fossa-action@f61a4c0c263690f2ddb54b9822a719c25a7b608f # v1.3.1
30
33
with :
31
34
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 5
5
branches :
6
6
- main
7
7
- release-*
8
+ tags :
9
+ - ' *'
8
10
paths-ignore :
9
11
- docs/**
10
12
- examples/**
Original file line number Diff line number Diff line change @@ -21,9 +21,6 @@ changelog:
21
21
checksum :
22
22
name_template : checksums.txt
23
23
24
- sboms :
25
- - artifacts : archive
26
-
27
24
release :
28
25
ids : [nginx-meshctl]
29
26
header : |
@@ -34,13 +31,11 @@ release:
34
31
archives :
35
32
- id : nginx-meshctl
36
33
builds : [nginx-meshctl]
37
- name_template : nginx-meshctl_{{ .Version }}_{{ .Os }}_{{ .Arch }}
34
+ name_template : nginx-meshctl_{{.Version}}_{{.Os}}_{{.Arch}}
38
35
format_overrides :
39
36
- goos : windows
40
37
format : zip
41
38
42
39
blobs :
43
40
- provider : azblob
44
41
bucket : ' {{.Env.AZURE_BUCKET_NAME}}'
45
- extra_files :
46
- - glob : ./dist/**.sbom
You can’t perform that action at this time.
0 commit comments