Skip to content

Commit b96e63e

Browse files
author
Black Duck
committed
Black Duck Security: Committed .github/workflows/polaris-workflow.yml
1 parent 39db632 commit b96e63e

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Quickstart: Bridge CLI with polaris:
2+
# https://blackduck-dev.zoominsoftware.io/bundle/bridge/page/documentation/t_github-polaris-cli-quickstart.html
3+
name: Polaris Bridge CLI Scan
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- master
9+
- develop
10+
- stage
11+
- release
12+
pull_request:
13+
branches:
14+
- main
15+
- master
16+
- develop
17+
- stage
18+
- release
19+
workflow_dispatch: {}
20+
jobs:
21+
polaris:
22+
runs-on: ubuntu-latest
23+
env:
24+
### SCANNING: Required fields
25+
BRIDGE_POLARIS_SERVERURL: ${{ vars.POLARIS_URL }}
26+
BRIDGE_POLARIS_ACCESSTOKEN: ${{ secrets.POLARIS_ACCESS_TOKEN }}
27+
### ASSESSMENT TYPES
28+
BRIDGE_POLARIS_ASSESSMENT_TYPES: SAST,SCA
29+
### SCANNING: Configuration fields
30+
BRIDGE_POLARIS_APPLICATION_NAME: ${{ github.event.repository.name }}
31+
BRIDGE_POLARIS_PROJECT_NAME: ${{ github.event.repository.name }}
32+
BRIDGE_POLARIS_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
33+
### GitHub repository information
34+
BRIDGE_GITHUB_REPOSITORY_OWNER_NAME: ${{ github.repository_owner }}
35+
BRIDGE_GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }}
36+
BRIDGE_GITHUB_REPOSITORY_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
37+
### SCANNING: Optional fields
38+
BRIDGE_POLARIS_TEST_SAST_LOCATION: hybrid
39+
BRIDGE_POLARIS_TEST_SCA_LOCATION: hybrid
40+
### SARIF report parameters
41+
BRIDGE_POLARIS_REPORTS_SARIF_CREATE: "true"
42+
### GITHUB TOKEN
43+
BRIDGE_GITHUB_USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
### TOOLING: Bridge CLI download URL
45+
BRIDGE_DOWNLOAD_URL: https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge/binaries/bridge-cli-bundle/latest
46+
steps:
47+
- name: Checkout Source
48+
uses: actions/checkout@v4
49+
50+
- name: Download & Setup Bridge CLI on Windows
51+
if: runner.os == 'Windows'
52+
shell: powershell
53+
run: |-
54+
curl.exe -L -o $env:TEMP\bridge.zip "$env:BRIDGE_DOWNLOAD_URL/bridge-cli-bundle-win64.zip"
55+
Expand-Archive $env:TEMP\bridge.zip -DestinationPath $env:TEMP\bridge -Force
56+
$exe = Get-ChildItem $env:TEMP\bridge -Recurse -Filter bridge-cli.exe | Select-Object -First 1
57+
"BRIDGE_CLI_INSTALL_DIR=$($exe.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Append
58+
59+
- name: Download & Setup Bridge CLI on macOS/Linux
60+
if: runner.os != 'Windows'
61+
shell: bash
62+
run: |-
63+
OS=$([[ "$RUNNER_OS" == "macOS" ]] && ([[ $(uname -m) =~ arm ]] && echo macos_arm || echo macosx) || ([[ $(uname -m) =~ arm ]] && echo linux_arm || echo linux64))
64+
curl -sSL -o bridge.zip "$BRIDGE_DOWNLOAD_URL/bridge-cli-bundle-$OS.zip"
65+
unzip -qo bridge.zip -d "$RUNNER_TEMP"
66+
echo "BRIDGE_CLI_INSTALL_DIR=$(find "$RUNNER_TEMP" -type f -name bridge-cli | head -n1)" >> "$GITHUB_ENV"
67+
68+
- name: Polaris Scan
69+
run: ${{ env.BRIDGE_CLI_INSTALL_DIR }} --stage polaris --diagnostics

0 commit comments

Comments
 (0)