Skip to content

Commit 18c5613

Browse files
committed
always generate mend report
Signed-off-by: Jakub Jarosz <[email protected]>
1 parent d439ab4 commit 18c5613

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/mend.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
#needs: check-if-allowed
7272
outputs:
7373
mend-report-file: ${{ steps.report.outputs.mend-report-file }}
74+
mend-scan-result: ${{ steps.scan.outputs.mend-scan-result }}
7475
steps:
7576
- name: Checkout Repository
7677
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -84,6 +85,7 @@ jobs:
8485
run: jarsigner -verify wss-unified-agent.jar
8586

8687
- name: Scan and upload
88+
id: scan
8789
env:
8890
WS_URL: "https://f5.whitesourcesoftware.com/agent"
8991
WS_APIKEY_NGINX: ${{ secrets.WS_APIKEY_NGINX }}
@@ -110,9 +112,13 @@ jobs:
110112
java -jar wss-unified-agent.jar -noConfig true -wss.url $WS_URL -apiKey $WS_APIKEY_NGINX -userKey $WS_USER_KEY -product $PRODUCT_NAME -project $PROJECT_NAME -d ./
111113
exit_code=$?
112114
115+
echo "mend-scan-result=$(echo $exit_code)" >> $GITHUB_OUTPUT
113116
echo -e "\nEXIT CODE is: $exit_code\n"
117+
114118
if (( exit_code == 254 )); then
115-
exit 254
119+
printf "\nMend scan detected problems.\n"
120+
exit 0
121+
# exit 254
116122
else
117123
printf "\nMend scan completed successfully. Exiting with code = 0\n"
118124
exit 0
@@ -136,3 +142,16 @@ jobs:
136142
name: mend-scan-report
137143
path: whitesource
138144
retention-days: 14
145+
146+
- name: Final scan result
147+
id: final
148+
run: |
149+
echo -e "\nEXIT CODE is: ${{ steps.scan.outputs.mend-scan-result }}\n"
150+
151+
if (( ${{ steps.scan.outputs.mend-scan-result }} == 254 )); then
152+
printf "\nMend scan detected problems.\n"
153+
exit 254
154+
else
155+
printf "\nMend scan completed successfully. Exiting with code = 0\n"
156+
exit 0
157+
fi

0 commit comments

Comments
 (0)