Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
.github/instructions
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ runs:
echo "Setting up CLI V2"
curl -Ls https://raw.githubusercontent.com/codacy/codacy-cli-v2/main/codacy-cli.sh -o /tmp/codacy-cli-v2
chmod +x /tmp/codacy-cli-v2
if [ "${{ inputs.api_token }}" != "" ]; then
/tmp/codacy-cli-v2 init --api-token ${{inputs.api_token}} --provider ${{inputs.provider}} --organization ${{inputs.organization}} --repository ${{inputs.repository}}
fi
if [ "${{ inputs.registry }}" != "" ]; then
/tmp/codacy-cli-v2 install -r ${{ inputs.registry }}
else
Expand All @@ -71,7 +74,11 @@ runs:
shell: bash
run: |
echo "Running the tool"
/tmp/codacy-cli-v2 analyze -t ${{inputs.tool}} --format sarif -o ${{inputs.sarif_file_path}}
if [ "${{ inputs.api_token }}" != "" ]; then
/tmp/codacy-cli-v2 analyze -t ${{inputs.tool}} ${{inputs.directory}} --format sarif -o ${{inputs.sarif_file_path}} --api-token ${{inputs.api_token}} --provider ${{inputs.provider}} --organization ${{inputs.organization}} --repository ${{inputs.repository}}
else
/tmp/codacy-cli-v2 analyze -t ${{inputs.tool}} --format sarif -o ${{inputs.sarif_file_path}}
fi
echo "Tool run complete"
- name: "Upload the results"
shell: bash
Expand Down