From 756b3fb2a831d66206113d84fa0d045beb962512 Mon Sep 17 00:00:00 2001 From: nicklem Date: Tue, 13 Dec 2022 13:59:31 +0100 Subject: [PATCH 1/2] doc: Update README parameters section --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6c925e4..5448f1a 100644 --- a/README.md +++ b/README.md @@ -179,12 +179,19 @@ To use the GitHub Action with Codacy integration: 5. Optionally, [enable the GitHub integration](https://docs.codacy.com/repositories-configure/integrations/github-integration/) on Codacy to have information about the analysis of the changed files directly on your pull requests. -## Extra configurations +## Parameters -The Codacy GitHub Action is a wrapper for running the [Codacy Analysis CLI](https://github.com/codacy/codacy-analysis-cli) and supports [the same parameters as the command `analyze`](https://github.com/codacy/codacy-analysis-cli#commands-and-configuration), with the following exceptions: +The Codacy GitHub Action is a wrapper for running the [Codacy Analysis CLI](https://github.com/codacy/codacy-analysis-cli). For a list of supported input parameters, see [`action.yml`](./action.yml). To pass input parameters to the action, [update the associated `with` map](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepswith). -- `--commit-uuid` (the action always analyzes the commit that triggered it) -- `--username` and `--project` (the action automatically uses the owner and name of the repository when you specify the parameter `api-token`) +The following example limits analysis to a `src` directory and provides additional details by setting `verbose` to `true`. + +```yaml +- name: Run Codacy Analysis CLI + uses: codacy/codacy-analysis-cli-action@master + with: + directory: src + verbose: true +``` ## Contributing From bfca6ba88afb26775097ebf33e2de9264871a992 Mon Sep 17 00:00:00 2001 From: nicklem Date: Tue, 13 Dec 2022 13:59:55 +0100 Subject: [PATCH 2/2] doc: Update action.yml parameter definitions --- action.yml | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/action.yml b/action.yml index 840b03d..40878a3 100644 --- a/action.yml +++ b/action.yml @@ -17,32 +17,34 @@ inputs: description: "API account token to retrieve your remote Codacy configuration for the project being analyzed" codacy-api-base-url: required: false - description: "Codacy's API URL, to retrieve your remote Codacy configuration" + description: "Codacy API URL to retrieve your remote Codacy configuration" format: required: false - description: "Format of the output file" + description: "Output file format" output: required: false - description: "Send analysis results to an output file" + description: "Path to a file to save the analysis results" directory: required: false - description: "The directory to be analyzed" + description: "Directory to analyze" parallel: required: false description: "Number of tools to run in parallel" max-tool-memory: required: false - description: "Maximum of allowed memory for each tool execution" + description: "Maximum allowed memory for running each tool (bytes)" max-allowed-issues: required: false default: "2147483647" description: "Maximum number of issues allowed for the analysis to succeed" tool: required: false - description: "The name of the tool to analyze the code" + description: >- + Only run a specific tool or tool category (metrics, issues, duplication). + For the full list of tools, see https://docs.codacy.com/repositories-configure/codacy-configuration-file/#which-tools-can-be-configured-and-which-name-should-i-use tool-timeout: required: false - description: "Maximum time each tool has to execute" + description: "Tool execution timeout (e.g. 15minutes, 1hour)" upload: required: false description: "Upload analysis results to Codacy" @@ -54,41 +56,36 @@ inputs: description: "Fail the analysis if any tool fails to run" allow-network: required: false - description: "Allow network access for tools" + description: "Allow the tools to access the network" force-file-permissions: required: false description: "Force files to be readable by changing the permissions before running the analysis" gh-code-scanning-compat: required: false description: >- - Reduce issue severity by one level, for non-security issues, for compatibility with GitHub's code scanning feature. - This option will only have an effect when used in conjunction with '--format sarif'. + Reduce issue severity by one level for non-security issues, for compatibility with GitHub's code scanning feature. + This option only has an effect when used with 'format: sarif'. run-docker-tools: required: false default: "true" description: >- - Run dockerized tools. Possible values (true|false) - Check the full list in https://docs.codacy.com/repositories-configure/codacy-configuration-file/#which-tools-can-be-configured-and-which-name-should-i-use + Run all dockerized tools supported by Codacy. + For the full list of tools, see https://docs.codacy.com/repositories-configure/codacy-configuration-file/#which-tools-can-be-configured-and-which-name-should-i-use run-gosec: required: false - description: >- - Run GoSec. Possible values (true|false) + description: "Run Gosec" run-staticcheck: required: false - description: >- - Run StaticCheck. Possible values (true|false) + description: "Run Staticcheck" clang-tidy-output: required: false - description: >- - Path to a file containing the output of Clang Tidy. + description: "Path to a file containing the output of Clang-Tidy." faux-pas-output: required: false - description: >- - Path to a file containing the output of Faux Pas. + description: "Path to a file containing the output of Faux Pas." skip-uncommitted-files-check: required: false - description: >- - Skip validation on uncommitted changes + description: "Skip validation of uncommitted changes" runs: using: "composite" steps: