diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03d2531 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ + + +#Ignore vscode AI rules +.github/instructions/codacy.instructions.md diff --git a/action.yml b/action.yml index 5866634..23cfcb7 100644 --- a/action.yml +++ b/action.yml @@ -47,6 +47,10 @@ inputs: default: "" description: >- Eventual registry address. + directory: + required: false + description: >- + Directory to analyze runs: using: "composite" @@ -71,7 +75,10 @@ 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.directory }}" != "" ]; then + /tmp/codacy-cli-v2 analyze -t ${{inputs.tool}} ${{inputs.directory}} --format sarif -o ${{inputs.sarif_file_path}} + else + /tmp/codacy-cli-v2 analyze -t ${{inputs.tool}} --format sarif -o ${{inputs.sarif_file_path}} echo "Tool run complete" - name: "Upload the results" shell: bash