Skip to content

Commit f12d90d

Browse files
committed
fix
1 parent ba955c6 commit f12d90d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/actions/semgrep-action/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ runs:
3434
- name: "Run semgrep"
3535
run: |
3636
results_file="/tmp/semgrep-results.${{ inputs.results_format }}"
37+
baseline_commit_arg=""
38+
if [ "${{ inputs.show_results_in_pr }}" = "true" ]; then
39+
baseline_commit_arg="--baseline-commit=${{ github.event.pull_request.base.sha }}"
40+
fi
3741
semgrep scan --config $HOME/semgrep-rules --config $HOME/semgrep-rules-tob \
3842
--metrics=off --experimental \
3943
--exclude-rule=third-party-action-not-pinned-to-commit-sha \
4044
--exclude-rule=jsx-not-internationalized \
4145
--severity=WARNING \
4246
--severity=ERROR \
4347
--exclude="*.html" --exclude="*.js" \
44-
--baseline-commit=${{ github.event.pull_request.base.sha }} \
48+
$baseline_commit_arg \
4549
--${{ inputs.results_format }} > "$results_file" || true
4650
shell: bash
4751
- name: "Set results file path output"

0 commit comments

Comments
 (0)