Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ inputs:
required: false
description: >-
Provider name (e.g., gh, gl, bb).
default: gh
owner:
required: false
description: >-
Expand Down Expand Up @@ -69,9 +70,13 @@ runs:
run: |
if [ "${{ inputs.upload_report }}" == "true" ]; then
echo "Uploading the results"
echo "Cleaning path"
sed -i.bak "s|$(pwd)/||g" ${{inputs.sarif_file_path}}
sed -i.bak "s|file://||g" ${{inputs.sarif_file_path}}
cat ${{inputs.sarif_file_path}}
if [ "${{ inputs.project_token }}" == "" ]; then
echo "Using API token"
/tmp/codacy-cli-v2 upload -s ${{inputs.sarif_file_path}} -c $COMMIT_SHA -a ${{inputs.api_token}} -p ${{inputs.provider}} -o ${{inputs.owner}} -r ${{inputs.repository}}
/tmp/codacy-cli-v2 upload -s ${{ inputs.sarif_file_path }} -c $COMMIT_SHA -p gh -o ${{ inputs.owner }} -r ${{ inputs.repository }} -a ${{ inputs.api_token }}
else
echo "Using project token"
/tmp/codacy-cli-v2 upload -s ${{inputs.sarif_file_path}} -c $COMMIT_SHA -t ${{inputs.project_token}}
Expand Down