Skip to content

Commit bc442c1

Browse files
authored
Ignore errors in exit codes (#28)
* Add organization-id input to action configuration * Handle command execution failure gracefully in Mobb action * Add conditional check for GitHub status action based on fix report URL * changed if condiiton on mobb url publishing * revert
1 parent 6c55ca0 commit bc442c1

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ This action posts the code and a SAST report to the Mobb vulnerability analysis
2828

2929
**Optional** `true` or `false`. This requires `auto-pr` to be set to `true`. Once set, Fixes will be committed directly to the source branch.
3030

31+
## `organization-id`
32+
33+
**Optional** The Organization ID to use with the Mobb platform. If not specified, the default organization will be used.
34+
3135

3236
## Outputs
3337

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ inputs:
2222
commit-directly:
2323
description: "Commit Directly flag, this requires Auto-PR flag to be set. Once enabled, Mobb will commit the fixes directly to the branch"
2424
required: false
25+
organization-id:
26+
description: "Organization ID"
27+
required: false
2528

2629
outputs:
2730
fix-report-url:
@@ -47,6 +50,12 @@ runs:
4750
MobbExecString+=" --mobb-project-name \"${{ inputs.mobb-project-name }}\""
4851
fi
4952
53+
# Check if organization-id exists and append it
54+
if [ -n "${{ inputs.organization-id }}" ]; then
55+
echo "organization-id specified: ${{ inputs.organization-id }}"
56+
MobbExecString+=" --organization-id \"${{ inputs.organization-id }}\""
57+
fi
58+
5059
# Check if auto-pr flag is set append it
5160
if [ "${{ inputs.auto-pr }}" == "true" ]; then
5261
echo "Auto-PR flag is set"

review/action.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,7 @@ runs:
7070
7171
# Output the final command string for debugging
7272
echo "Mobb Command: $MobbExecString"
73-
OUT=$(eval $MobbExecString)
74-
75-
RETVAL=$?
76-
if [ $RETVAL -ne 0 ]; then
77-
exit $RETVAL
78-
fi
73+
OUT=$(eval $MobbExecString || true)
7974
OUT=$(echo $OUT | tr '\n' ' ')
8075
8176
echo "fix-report-url=$OUT" >> $GITHUB_OUTPUT
@@ -84,6 +79,7 @@ runs:
8479
shell: bash -l {0}
8580

8681
- uses: Sibz/github-status-action@v1
82+
if: ${{ startsWith(steps.run-npx-mobb-dev.outputs.fix-report-url, 'https://') }}
8783
with:
8884
authToken: ${{ inputs.github-token }}
8985
context: "Mobb fix report link"

0 commit comments

Comments
 (0)