From 6740e05cec2cedf404d1dda555bb537662e39444 Mon Sep 17 00:00:00 2001 From: DMarinhoCodacy Date: Mon, 10 Nov 2025 12:43:53 +0000 Subject: [PATCH] Add support directories --- .gitignore | 4 ++++ action.yml | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .gitignore 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