Black Duck Policy Check #40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Black Duck Policy Check | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
push: | |
branches: | |
- main | |
- 'release-*' | |
pull_request: | |
paths: | |
- '.github/**' | |
pull_request_target: | |
paths-ignore: | |
- '.github/**' | |
jobs: | |
security: | |
if: github.repository == 'nutanix-cloud-native/cloud-provider-nutanix' | |
runs-on: ubuntu-22.04 | |
permissions: | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install devbox | |
uses: jetify-com/devbox-install-action@v0.12.0 | |
with: | |
enable-cache: true | |
- name: Go cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Build Project | |
run: devbox run -- make build | |
- name: Set up Java 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "11" | |
distribution: "adopt" | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Black Duck Full Scan | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: blackduck-inc/black-duck-security-scan@v2.1.1 | |
with: | |
blackducksca_url: ${{ secrets.BLACKDUCK_URL }} | |
blackducksca_token: ${{ secrets.BLACKDUCK_API_TOKEN }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
blackducksca_scan_full: true | |
blackducksca_scan_failure_severities: 'BLOCKER,CRITICAL' | |
- name: Black Duck PR Scan | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: blackduck-inc/black-duck-security-scan@v2.1.1 | |
env: | |
DETECT_PROJECT_VERSION_NAME: ${{ github.base_ref }} | |
with: | |
blackducksca_url: ${{ secrets.BLACKDUCK_URL }} | |
blackducksca_token: ${{ secrets.BLACKDUCK_API_TOKEN }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
blackducksca_scan_full: false | |
blackducksca_prComment_enabled: true |