Skip to content

Commit fb0368c

Browse files
committed
ci: Add blackduck scanning workflow
1 parent 8448eb8 commit fb0368c

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/synopsys.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Copyright 2024 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Black Duck Policy Check
5+
on:
6+
pull_request:
7+
branches:
8+
- main
9+
# Only scan when product source dependencies change.
10+
paths:
11+
- '**/go.mod'
12+
# Ignore source dependencies of build tooling.
13+
- '!docs/go.mod'
14+
push:
15+
branches:
16+
- main
17+
# Only scan when product source dependencies change.
18+
paths:
19+
- '**/go.mod'
20+
# Ignore source dependencies of build tooling.
21+
- '!docs/go.mod'
22+
23+
jobs:
24+
security:
25+
if: github.repository == 'nutanix-cloud-native/cluster-api-runtime-extensions-nutanix'
26+
runs-on: ubuntu-22.04
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Install devbox
32+
uses: jetify-com/[email protected]
33+
with:
34+
enable-cache: true
35+
36+
- name: Go cache
37+
uses: actions/cache@v4
38+
with:
39+
path: |
40+
~/.cache/go-build
41+
~/go/pkg/mod
42+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
43+
restore-keys: |
44+
${{ runner.os }}-go-
45+
46+
- name: Build Project
47+
run: devbox run -- make build-snapshot
48+
49+
- name: Black Duck Full Scan
50+
if: ${{ github.event_name != 'pull_request' }}
51+
uses: synopsys-sig/[email protected]
52+
with:
53+
blackduck_url: ${{ secrets.BLACKDUCK_URL }}
54+
blackduck_token: ${{ secrets.BLACKDUCK_API_TOKEN }}
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
blackduck_scan_full: true
57+
blackduck_scan_failure_severities: 'BLOCKER,CRITICAL'
58+
59+
- name: Black Duck PR Scan
60+
if: ${{ github.event_name == 'pull_request' }}
61+
uses: synopsys-sig/[email protected]
62+
env:
63+
DETECT_PROJECT_VERSION_NAME: ${{ github.base_ref }}
64+
with:
65+
blackduck_url: ${{ secrets.BLACKDUCK_URL }}
66+
blackduck_token: ${{ secrets.BLACKDUCK_API_TOKEN }}
67+
github_token: ${{ secrets.GITHUB_TOKEN }}
68+
blackduck_scan_full: false
69+
blackduck_prComment_enabled: true

0 commit comments

Comments
 (0)