Skip to content

Blackduck Scan

Blackduck Scan #225

Workflow file for this run

name: 'Blackduck Scan'
on:
workflow_dispatch:
schedule:
- cron: 0 23 * * *
jobs:
scan:
name: "Blackduck Scan"
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- run: git fetch --depth=1
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
cache: maven
# Fixme: Use major version from pom once it is 5.x
- name: Get SDK Version
run: |
echo "project_version_NOT_YET_IN_USE=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d '.' -f 1)" >> $GITHUB_ENV
- name: Determine Maven Excludes
run: |
python .pipeline/scripts/get-maven-excludes.py --filter-key excludeFromBlackDuckScan --filter-value True
id: get-maven-excludes-for-blackduck
- name: Blackduck Scan
uses: SAP/project-piper-action@27cadf261545552a68660531476c0915a97ee3d8
with:
command: detectExecuteScan
flags: \
--version=$PROJECT_VERSION \
env:
PIPER_token: ${{ secrets.BLACKDUCK_TOKEN }}
DETECT_MAVEN_EXCLUDED_MODULES: ${{ steps.get-maven-excludes-for-blackduck.outputs.EXCLUDES }}
DETECT_MAVEN_BUILD_COMMAND: -pl ${{ steps.get-maven-excludes-for-blackduck.outputs.PREFIXED_EXCLUDES }}
DETECT_TIMEOUT: 7200
PROJECT_VERSION: "5"
notify-job:
runs-on: ubuntu-latest
needs: [ scan ]
if: ${{ failure() && github.ref == 'refs/heads/main' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Notify
run: python .pipeline/scripts/notify.py
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
WORKFLOW: ${{ github.workflow }}
WORKFLOW_RUN_URL: https://github.com/SAP/cloud-sdk-java/actions/runs/${{ github.run_id }}
BRANCH_NAME: ${{ github.ref_name }}