Skip to content

Commit abcd9db

Browse files
committed
ci: add Mend scan workflow for SAST and SCA
1 parent 9af7729 commit abcd9db

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

.github/workflows/mend.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Mend Scan
2+
3+
on:
4+
workflow_dispatch:
5+
schedule: [cron: "0 0 * * 0"] # Weekly on Sundays at midnight
6+
7+
# For PRs we only trigger if the workflow file itself is changed, for testing purposes.
8+
pull_request:
9+
branches: [master]
10+
paths:
11+
- .github/workflows/mend.yml
12+
13+
env:
14+
MEND_APP_NAME: "vespa-engine"
15+
MEND_PROJECT_NAME: "vespa"
16+
17+
jobs:
18+
sast:
19+
name: SAST Vespa Engine
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
25+
- name: Mend SAST
26+
uses: vespa-engine/gh-actions/mend-sast@marlon/feat/add-mend-scan-workflow
27+
with:
28+
mend-user: ${{ secrets.MEND_EMAIL }}
29+
mend-api-key: ${{ secrets.MEND_USER_KEY }}
30+
31+
mend-app-name: ${{ env.MEND_APP_NAME }}
32+
mend-project-name: ${{ env.MEND_PROJECT_NAME }}
33+
# Do not send SAST updates on PRs
34+
# update: ${{ contains(fromJson('["workflow_dispatch","schedule"]'), github.event_name) }}
35+
update: true # Temporarily always send SAST updates
36+
37+
# Scan only: C++, Java
38+
scan-name: "Vespa @ ${{ github.ref_name }} (${{ github.sha }})"
39+
target-directory: "./"
40+
enabled-engines: "12,101"
41+
42+
sast-cli:
43+
name: SAST Vespa CLI
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
49+
- name: Mend SAST
50+
uses: vespa-engine/gh-actions/mend-sast@marlon/feat/add-mend-scan-workflow
51+
with:
52+
mend-user: ${{ secrets.MEND_EMAIL }}
53+
mend-api-key: ${{ secrets.MEND_USER_KEY }}
54+
55+
mend-app-name: ${{ env.MEND_APP_NAME }}
56+
mend-project-name: ${{ env.MEND_PROJECT_NAME }}
57+
# Do not send SAST updates on PRs
58+
# update: ${{ contains(fromJson('["workflow_dispatch","schedule"]'), github.event_name) }}
59+
update: true # Temporarily always send SAST updates
60+
61+
# Scan only: C++, Java
62+
# Scan only: Go
63+
scan-name: "Vespa CLI @ ${{ github.ref_name }} (${{ github.sha }})"
64+
target-directory: "client/go"
65+
enabled-engines: "18"
66+
67+
sca:
68+
name: SCA
69+
runs-on: ubuntu-latest
70+
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
74+
- uses: actions/setup-java@v4
75+
with:
76+
java-version: "17"
77+
distribution: "temurin"
78+
cache: maven
79+
80+
- name: Install Vespa Deps
81+
run: |
82+
export MAVEN_OPTS="-Xms2048m -Xmx2048m"
83+
./bootstrap.sh java
84+
85+
- name: Set GO
86+
uses: actions/setup-go@v5
87+
with:
88+
go-version: '1.24'
89+
90+
- name: Build Vespa CLI
91+
working-directory: client/go
92+
run: |
93+
go mod download
94+
95+
96+
- name: Mend SCA
97+
uses: vespa-engine/gh-actions/mend-sca@marlon/feat/add-mend-scan-workflow
98+
with:
99+
mend-user: ${{ secrets.MEND_EMAIL }}
100+
mend-api-key: ${{ secrets.MEND_USER_KEY }}
101+
102+
mend-app-name: ${{ env.MEND_APP_NAME }}
103+
mend-project-name: ${{ env.MEND_PROJECT_NAME }}
104+
105+
# Do not send SCA updates on PRs
106+
# update: ${{ contains(fromJson('["workflow_dispatch","schedule"]'), github.event_name) }}
107+
update: true # Temporarily always send SCA updates

0 commit comments

Comments
 (0)