-
Notifications
You must be signed in to change notification settings - Fork 5
/
action.yml
45 lines (45 loc) · 1.35 KB
/
action.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
name: "mobbdev"
description: "Mobb automatic vulnerability fixer action"
branding:
icon: aperture
color: blue
inputs:
report-file:
description: "Path to SAST report file"
required: true
api-key:
description: "Mobb API key"
required: true
github-token:
description: "GitaHub Token"
required: true
outputs:
fix-report-url:
description: "Mobb fix report URL"
value: ${{ steps.run-npx-mobb-dev.outputs.fix-report-url }}
runs:
using: "composite"
steps:
- uses: actions/[email protected]
with:
node-version: 18
- id: run-npx-mobb-dev
run: |
REPO=$(git remote get-url origin)
REPO=${REPO%".git"}
BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
OUT=$(npx --yes mobbdev@latest analyze --ci -r $REPO --ref $BRANCH --api-key ${{ inputs.api-key }} -f ${{ inputs.report-file }})
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
exit $RETVAL
fi
OUT=$(echo $OUT | tr '\n' ' ')
echo "fix-report-url=$OUT" >> $GITHUB_OUTPUT
shell: bash -l {0}
- uses: Sibz/github-status-action@v1
with:
authToken: ${{ inputs.github-token }}
context: "Mobb fix report link"
state: "success"
target_url: ${{ steps.run-npx-mobb-dev.outputs.fix-report-url }}
sha: ${{github.event.pull_request.head.sha || github.sha}}