generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (51 loc) · 1.87 KB
/
fosstars-report.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: "Fosstars (Security)"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # every day at midnight
env:
MVN_MULTI_THREADED_ARGS: --batch-mode --no-transfer-progress --fail-at-end --show-version --threads 1C
JAVA_VERSION: 17
jobs:
create_fosstars_report:
runs-on: ubuntu-latest
name: "Security rating"
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Setup java"
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ env.JAVA_VERSION }}
cache: 'maven'
- name: Restore CVE Database
uses: actions/cache/restore@v4
with:
path: ${{ env.CVE_CACHE_DIR }}
key: ${{ env.CVE_CACHE_KEY }}
fail-on-cache-miss: true
- name: "Build SDK"
run: |
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean install -DskipTests -DskipFormatting"
mvn $MVN_ARGS
- name: "OWASP Dependency check"
run: mvn org.owasp:dependency-check-maven:10.0.4:check -DnvdApiKey=$NVD_API_KEY -DfailBuildOnCVSS=7 -DskipProvidedScope=true -DsuppressionFile=.pipeline/dependency-check-suppression.xml
env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
- name: "Fosstars rating"
uses: SAP/[email protected]
with:
report-branch: fosstars-report
token: ${{ secrets.GITHUB_TOKEN }}
- name: "Slack Notification"
if: failure()
uses: slackapi/[email protected]
with:
payload: |
{
"text": "⚠️ OWASP Dependency check failed! 😬 Please inspect & fix by clicking <https://github.com/SAP/ai-sdk-java/actions/runs/${{ github.run_id }}|here>"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK