Skip to content

Commit

Permalink
Merge pull request #92 from codacy/doc/cli-options-DOCS-180
Browse files Browse the repository at this point in the history
doc: Improve CLI parameters DOCS-180
  • Loading branch information
nicklem authored Dec 13, 2022
2 parents 0e9ceb2 + bfca6ba commit c4be364
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
41 changes: 19 additions & 22 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down

0 comments on commit c4be364

Please sign in to comment.